I'm implementing a propiertary protocol for a company which is actually an extension of HTTP (extended with some specific headers). If I use the .NET class HttpWebRequest and HttpWebResponse respectively I can easily communicate with the server by setting the necessary headers.
Since any further requests/responses should be sent over the connection, established after the first request, for receiving events from the server, I have to left the stream in HttpWebRequest be opened (I cannot change the server application).
Unfortunately the stream by calling the method GetRequestStrea m is closed after one request/response.
The KeepAlive property is also not an option, since the server has to be HTTP/1.1 compliant for that to work and it will break the connection somewhere in time (even on non-fatal errors).
My question if there is a change to introduce something like a method "SetRequestStre am" into a subclass of HttpWebRequest for example to specify which stream has to be used for the connection.
But I doubt that this works since one has no access to the socket-level in the class HttpWebRequest. Using the source code (ROTOR project) of HttpWebRequest is also not an option since this application is going to be commercial.
I hope someone has some useful ideas...
Since any further requests/responses should be sent over the connection, established after the first request, for receiving events from the server, I have to left the stream in HttpWebRequest be opened (I cannot change the server application).
Unfortunately the stream by calling the method GetRequestStrea m is closed after one request/response.
The KeepAlive property is also not an option, since the server has to be HTTP/1.1 compliant for that to work and it will break the connection somewhere in time (even on non-fatal errors).
My question if there is a change to introduce something like a method "SetRequestStre am" into a subclass of HttpWebRequest for example to specify which stream has to be used for the connection.
But I doubt that this works since one has no access to the socket-level in the class HttpWebRequest. Using the source code (ROTOR project) of HttpWebRequest is also not an option since this application is going to be commercial.
I hope someone has some useful ideas...
Comment