I am using the Connector "socket://" protocol to connect to a server with the 7650. I couldn't get HTTPConnection to work -- it may be broken.
Anyway, using "socket://" works fine on the 7650. By the way, it works fine, but you have to use GPRS, and don't use a WAP gateway, set it to 0.0.0.0.
I send HTTP requests over the socket connection (in this case POST)and parse HTTP responses from the sever.
On the server side I can see the socket being connected and I can read the IP address and port of the handset... ..hmm or is it the handset. I don't think the IP is a gateway it looks like a dynamic address because it changes.
Though this looks like a socket it doesn't work like one. While the socket is open I can send data from the server but it never gets to the handset. If I send data from the handset it gets to the server fine. It seems that the only way this connection to work is to open the socket, write the data, flush the output, immediately open the inputStream and wait for response, read it until the stream returns -1 (eof). Close down. Any delay in this process and it seems the inputStream is empty.
Does anybody know what is going on here?
Yes I know sockets aren't really "supported", but it works fine in this application and HTTPConnection never worked for me.