Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
slimshady639
Posts: 6
Registered: ‎10-06-2009
My Device: Not Specified

Issues with UDPDatagramConnection

 Hello, I'm getting IOException when I send a datagram to my udp server from 4.5 or 4.6 version simulators. But the same code works fine with 4.7 simulators. Can somebody tell does 4.5 and 4.6 OS version of Blackberry support UDP or not..I checked the samples that we get with JDEs. I could see an UDP example only with the 4.7 version and not with 4.5 or 4.6. Thanks in advance...

Please use plain text.
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Issues with UDPDatagramConnection

UDP works fine on v4.5.0.83+ and all v4.6+. It doesn't work in some simulators though. For example, UDP works just fine in the Curve 8900 simulator bundled in JDE v4.6.1.

Please use plain text.
Developer
DAquilina
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: Issues with UDPDatagramConnection

Other simulators in which UDP functions:

 

- Storm 9530

- Bold 9000

- Bold 9700

- 8830 World Editon

----------------------------------------------------------------------------
chown -R us ./base
~J!NX
Please use plain text.
New Developer
slimshady639
Posts: 6
Registered: ‎10-06-2009
My Device: Not Specified

Re: Issues with UDPDatagramConnection

Thanks for your replies. I was trying to send datagrams to a private IP. Is that a problem? Can I connect to a private ip from my blackberry device. Thanks in advance.
Please use plain text.
Developer
DAquilina
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: Issues with UDPDatagramConnection

I don't see why not. You have to ensure that the Firewall on the other end will let the packet in, but the connection itself is viable. Just bear in mind that BlackBerry devices do not have IPs of their own.

 

Hope that helps,

~Dom

----------------------------------------------------------------------------
chown -R us ./base
~J!NX
Please use plain text.
Developer
Aviator168
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: Issues with UDPDatagramConnection

[ Edited ]

 


slimshady639 wrote:

 Hello, I'm getting IOException when I send a datagram to my udp server from 4.5 or 4.6 version simulators. But the same code works fine with 4.7 simulators. Can somebody tell does 4.5 and 4.6 OS version of Blackberry support UDP or not..I checked the samples that we get with JDEs. I could see an UDP example only with the 4.7 version and not with 4.5 or 4.6. Thanks in advance...


 

UDP works on the Bold simulator (v4.6.0.293)  However, sometimes I will get an IOException on the device. When that happens, I just re-create a new datagram object.

 

Please use plain text.
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Issues with UDPDatagramConnection

BlackBerrys do have IP addresses assigned to them. For example, they do have an IP address assigned to their WLAN interface (when it's connected to a WLAN). They also do have an IP address assigned to them by the carrier for each IP tunnel to a Packet Data Network (PDN, as identified by APN), although it most typical scenarios that IP address is a private IP address.

Please use plain text.
New Contributor
titore
Posts: 2
Registered: ‎03-16-2011
My Device: I am a developer
My Carrier: I haven´t

Re: Issues with UDPDatagramConnection


Hello, I'm getting an IllegalArgumentException when I try to send a datagram using udp with UDPDatagramConnection.
I use 4.5 SDK version.
The text in the excepction is "java.lang.IllegalArgumentException: Bad address"
When I debug, the _address in the Datagram have the value "datagram://200.123.130.117:5060" (IP from my server)
when I execute the line "socket.send(dgram);" where "socket is a UDPDatagramConnection and dgram is the Datagram", I have the exception.
I don´t understand what is wrong.
Can somebody help me please?
Thanks in advance...

Please use plain text.
Developer
arkadyz
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Issues with UDPDatagramConnection

@titore: Welcome to the forums!

 

Unfortunately, pre-4.7 BlackBerrys had trouble working with UDP. If you can replace it with TCP, do so. If you can't, you are out of luck (seriously).

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Please use plain text.
New Contributor
titore
Posts: 2
Registered: ‎03-16-2011
My Device: I am a developer
My Carrier: I haven´t

Re: Issues with UDPDatagramConnection

really? ups...

I can´t to replace with TCP!!! :No: the server only works with udp...

 

if I migrate other version? 4.7 o higher?

 

 

Please use plain text.