G
Guest
I'm using the HttpWebRequest repeatidly. I have basic authentication, unsafe connection pooling, keepalive, and preauthentication on. Within .NET it clearly reuses the http connections, I can easily verify this is correct with a packet sniffer. I may make 1000s of requests over 1-2 established http connections in a given time period.
Then the application sits idling for a while, until the user is ready to something. The next attempt to hit the server fails. The request is running the exact same code as the first time, there is no state being held around from the first time, when calling the HttpWebRequest.GetResponse() I receive a NullReferenceException (object not set to an instance of an object...), and get no call stack or location information which leads me to believe its on some secondary thread/deep in the .NET implementation.
in any case, I'm sure this has been seen by others, and some solution/workaround/stupid thing I may be doing is out there, a point in the right direction would be great. again, theres no problem with making the requests (GET & POST several times), its just when it idles for a while, and I can only assume that the remote server kills the keepalive connections, but .NET doesn't know this and tries to reuse them anyway internally.
Then the application sits idling for a while, until the user is ready to something. The next attempt to hit the server fails. The request is running the exact same code as the first time, there is no state being held around from the first time, when calling the HttpWebRequest.GetResponse() I receive a NullReferenceException (object not set to an instance of an object...), and get no call stack or location information which leads me to believe its on some secondary thread/deep in the .NET implementation.
in any case, I'm sure this has been seen by others, and some solution/workaround/stupid thing I may be doing is out there, a point in the right direction would be great. again, theres no problem with making the requests (GET & POST several times), its just when it idles for a while, and I can only assume that the remote server kills the keepalive connections, but .NET doesn't know this and tries to reuse them anyway internally.