01-12-2012 08:35 AM
I am trying to create UDP connection over 3G but I am getting IOException: APN not specified.
Now I have read all the threads and tutorials and I am trying all the ways suggested in these tutorials and I am using the correct APN for my carrier. I believe I am creating the connections strings correctly and the app works with WIFI but if I disable the wifi it tries with 3G and simply throws the IOException.
I am testing on a Bold 9780 with OS6.
I was wondering if there is possible OS/device limitation for UDP over 3G or some sort of carrier limitation.
I can provide the code I am using but still I would like to know if there is some sort of known issue with this.
Solved! Go to Solution.
01-12-2012 09:26 AM
Can you show the udp connection string?
01-12-2012 09:39 AM
01-12-2012 09:48 AM
@simon_hain - I am not using apn for wifi. I will try the tool too.
Here are all the urls I am trying(with disabled wifi network):
udp://:1234 udp://:1234;deviceside=true udp://:1234/wap-gprs.mtel.bg udp://:1234;deviceside=true;apn=wap-gprs.mtel.bg udp://:1234/blackberry.net udp://:1234;deviceside=true;apn=blackberry.net udp://:1234;deviceside=true;ConnectionUID=WAP2 trans
As you can see I am opening the UDP connection in server mode on port 1234
01-12-2012 09:48 AM
httpTest = (HttpConnection) Connector.open(
01-12-2012 09:57 AM
pe>][;tunnelauthusername=<apn username>;tunnelauthpassword=<apn password>]");
dest_port must be specified in order to send data on this connection. If src_port is not specified then it is set to the same value as dest_port by default.
If the connection is to be used to receive data then src_port must be specified. dest_port can be excluded on inbound connections allowing the connection to receive datagrams from all destination ports.
Note: When testing your applications within the RIM Simulator, you must use the following command line switch to open a port for listening:
If you attempt to send a datagram on a UDP connection and you are not listening on src_port then an IOException will be thrown.
Note: The handheld's user can select the default UDP connection behaviour; you can override ths behaviour with the previous described parameters.
Input and output streams can be acquired using the openInputStream and openOutputStream methods.
01-19-2012 06:31 AM
@marcwlux - thanks it seems to work well.
It turned out that if I want to open UDP connection in server mode on local port 1234 I have to do it like this:
- for wifi: udp://:1234;deviceside=false;interface=wifi
- for 3g: udp://;1234;deviceside=true;apn=blackberry.net
Note the difference in : and ; . When I tried to open it for wifi using ; instead of : I got IOException.
Hope this is helpful for someone.