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
Shekhar_H
Posts: 122
Registered: ‎09-04-2008
My Device: Storm II Model 9550
My Carrier: Developer

Re: Peer to Peer communication.

Any thought on this?

 

If someone plese help, it is very helpful for me.

 

-Shekhar.

Please use plain text.
New Developer
Shekhar_H
Posts: 122
Registered: ‎09-04-2008
My Device: Storm II Model 9550
My Carrier: Developer

Re: Peer to Peer communication.

Hi ,

 

I got IOException while sending the datagram packet from one mobile device to another mobile device. I have tried both the ways ( "datagram://" and "udp://" )of making UDPDatagramconnection but in both the cases IOException is coming.

 

Could anyone please help me out on this ?

 

 

-Shekhar

Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Peer to Peer communication.

try to send and receive from different ports.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Developer
Shekhar_H
Posts: 122
Registered: ‎09-04-2008
My Device: Storm II Model 9550
My Carrier: Developer

Re: Peer to Peer communication.

Thanks a lot Simon for response

 

Yes I am trying to send from one device and receiving from another device so receiver device is opened in server mode and sender device is opened as an client. But getting exception while trying to send the datagram and reveiver is till waiting for the datagram.

Here is the code -

                    

                    UDPDatagramConnection UdpInstance = (UDPDatagramConnection)Connector.open(serverUrl);

                 
                    
                    Datagram datagram = UdpInstance.newDatagram(200);
                    String testData = "HelloClient 1";
                    datagram.reset();
                    datagram.write(testData.getBytes());    // written the byte array 
                
                    UdpInstance.send(datagram);

 

Could you please tell me where I am doing wrong ?

 

 

- Shekhar

 

Please use plain text.
New Developer
Shekhar_H
Posts: 122
Registered: ‎09-04-2008
My Device: Storm II Model 9550
My Carrier: Developer

Re: Peer to Peer communication.

one more thing to say. Is there any problem with IP address and port number, if the IP address or port number is wrong so will I get any exception in creation of the instance ? we are taking the IP address and port number of the device from one public STUN server.

 

 

- Shekhar

Please use plain text.
New Developer
mkumar
Posts: 18
Registered: ‎09-11-2009
My Device: Not Specified

Re: Peer to Peer communication.

Hi All,

 

I am also facing the same problem as above post, I am getting exception while sending the UDP datagram packet from one device to another device. Because in the same way I am able to send datagram to server and can receive the datagram from server successfully but getting exception when I am sending data from one mobile device to another mobile device. For knowing the IP address and the port number  of other device I am also using one public STUN server that is "stun.xten.com". So is there any problem with IP address or port number. Would I get exception at the time of instance creation if IP or port is wrong ?

 

Can anyone please help me out on this ?


Regards


Mohit Tyagi

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

Re: Peer to Peer communication.

Keep in mind that prior to v4.6.0 handheld software, UDP sending works only on v4.5.0.83+. On v4.5.0.82- you get an IOException with null or empty detail message.

 

Another reason why you might be getting an IOException is that, according to javadocs, you're supposed to listen for incoming datagrams even if you aren't expecting any reply.

Please use plain text.
New Developer
mkumar
Posts: 18
Registered: ‎09-11-2009
My Device: Not Specified

Re: Peer to Peer communication.

Hi Guys,

 

I have achieved this and developed a voice communication application with different codecs. Feel free to reach out to me if you need any help, thanks.

 

 

Regards,

 

Mohit Tyagi

Please use plain text.
New Member
jhdezc_01
Posts: 1
Registered: ‎04-26-2012
My Device: 9360
My Carrier: Telcel

Re: Peer to Peer communication.

hi mkumar

 

I´m sorry, my english is no good :smileyvery-happy:
How you have achieved developed the communication?
You have a references information about voice IP?

 

Thanks. :smileyvery-happy:

Please use plain text.