This turned out to be a cascade of errors. First, SendRequest() was not handling a Keep-Alive error. There was no response and it was trying to read it and it was null. I fixed that and then observed that the Keep-Alive errors were random. Sometimes it worked, sometimes not.
My conclusion is that their server has a 10 second Keep-Alive timeout and my polling interval for session and job are 10 seconds. Thus a race!! I programmatically disabled Keep-Alive on the requests. |