07-03-2005, 08:44 PM
Join Date: May 2005
Post Thanks: 0
Thanked 0 Times in 0 Posts
| | IPPP sockets and http
Please Login to Remove!
Hi, I was wondering if anyone could help me here.
I need to able to open a http connection for reading and writing (the reason being for http tunneling) and be able to read from the socket without the framework attempting to read the whole content before returning from opening the inputstream.
I am pretty sure that I will not be able to do it as I have investigated, but I thought someone may know a way that I am not aware of.
I can see in the http connection that operations such as flush on the outputstream, or openInputStream(), or getResponseCode() etc, end up calling HttpProtocolBase.transitionToState() which in turn calls ClientProtocol.readResponse() which attempts to read the content before returning. I know this makes sense after all http is designed for content delivery type request response.
The application uses a socket usually, but inevitably some clients are only allowed to go out of their network through a http proxy. The problem is to utilize the proxy that the MDS is configured to use i need to use the http connection, I cannot simply mimic the http protocol using a socket.
It seems that IPPP knows whether the TCP connection is intended for use in http connection, from the log file on a MDS simluator for IPPP events I can see that a socket opened on port 80 has the parameters
CONNECTIONHANDLER = , PROTOCOL = TCP
whereas a http connection opened to the same machine on port 80 has
CONNECTIONHANDLER = httpc, PROTOCOL = TCP
I can understand this also as the MDS needs to know whether or not to use the proxy settings, it can't just assume to use them for any socket connection to port 80 (or any socket connection to any port for that matter).
I guess my question is how can I get around this, I can't get to the underlying socket and prevent transitionToState from being called, I don't think I can modify the IPPP connection parameters from the handheld to make to the MDS use the http connection handler (and even then the http connection handler on the MDS may decide to do the same thing ie, read the whole response before sending it to the handset).
I know that I can get around it by changing the framework of the application (use polling or something) but its intended use is for streaming data to the handset (without running software behind the clients firewall, touching the clients MDS or knowing about the clients bes configuration (so can't use http pushes either)).
Thanks for any help or ideas that anyone has.