03-27-2012 11:44 AM
Hi all,
I am stuck with an issue related to socket connections.
On WIFI I am opening a socket connection with the following line:
SocketConnection connection = (SocketConnection) Connector.open("socket://212.107.31.2:2299;devices ide=true;interface=wifi;");
As expected the line returns an object of type net.rim.device.cldc.io.tcpsocket.TcpClientConnecti
With WIFI disabled I use the following line to retrieve a socket connection over 3G:
SocketConnection connection = (SocketConnection) Connector.open("socket://212.107.31.2:2299;devices ide=true;");This is where it gets weird as now an object of type net.rim.device.cldc.io.devicehttp.ClientProtocol is returned instead of the expected TcpClientConnection. Opening an InputStream on the ClientProtocol results in a EOFException, the stacktrace:
[0.0] EOFException [0.0] No detail message [0.0] net_rim_os-3(4BE21A1D) [0.0] Utilities [0.0] receiveLine [0.0] 0xBAEC [0.0] net_rim_os-3(4BE21A1D) [0.0] StatusLine [0.0] readFromStream [0.0] 0xA480 [0.0] net_rim_os-2(4BE21A1D) [0.0] ClientProtocol [0.0] readResponse [0.0] 0x16DE [0.0] net_rim_os-3(4BE21A1D) [0.0] HttpProtocolBase [0.0] transitionToState [0.0] 0x4120 [0.0] net_rim_os-3(4BE21A1D) [0.0] HttpProtocolBase [0.0] openInputStream [0.0] 0x44B4 [0.0] net_rim_os-3(4BE21A1D) [0.0] HttpProtocolBase [0.0] openDataInputStream [0.0] 0x44F0 [0.0] socket_test(4A71D639) [0.0] SocketThread [0.0] <private> [0.0] 0x65DE [0.0] socket_test(4A71D639) [0.0] SocketThread [0.0] run [0.0] 0x46FE
BTW in case you are wondering I have a full data plan including direct TCP and I can confirm this when I use the sim card in my Android phone.
What am I doing wrong? Any help is appreciated!!!
Thanks,
Emma
Details: Plattform 6.6.0.212, App Version 6.0.0.570, Device Curve 9300, Carrier Vodafone
Solved! Go to Solution.
03-27-2012 12:30 PM
I would remove the trailing semicolon from here:
deviceside=true;");
and do the same for WiFi.
If you are using deviceside=true, then you need to have set up APN parameters for your carrier in the TCP Options on your device.
I would also be a little cautious with the Port. I have not be able to connect over anything but standard ports (80 and 443) when using socket connections over the carrier supplied TCP network. Try what you are doing with a Server listening on port 80 and see if that works. Then move it it to 2299.
03-28-2012 05:07 AM
Thank you Peter for putting me on the right track. It was indeed a port issue. A call to the provider confirmed that my data plan is in fact unlimited in terms data volume not so, however, in terms of ports and services. In other words i am stuck with 80/443 unless i extend my data plan.
Thanks again Peter, you made my day!!!
Emma