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

Native Development

Reply
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition

All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

[ Edited ]

Hi All,

          I am developing network app based on Sockets (TCP/UDP)  using cascades. I tested my code on PC using QTCreator and it worked fine. when I ported client code to BB10 cascades and tried to connect to PC, it failed to connect.

 

I downloaded all sockets tutorials from BB10 tutorials repositories and they failed to connect to PC.

 

I uploaded sample code that doesn't work with me: MyUdpTest

 

Please help as it is very important for me to finish my app

 

Thank you,

Hisham

When you are young, work to learn. Not to earn !
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course

Re: All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

Check the firewall on your PC...

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition

Re: All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

the issue is not related to firewall

 

I alreade developed Android app : https://play.google.com/store/apps/details?id=com.allinoneremote

 

and I ported it to BB10 with android runtime and it works fine on bb10 device 

but I am rewriting my app using cascades and it doesnt work

When you are young, work to learn. Not to earn !
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition

Re: All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

any help :smileysad:

When you are young, work to learn. Not to earn !
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

hi,

 

the problem appears to be your bind - you are telling the socket to only accept from and send to LocalHost.

 

-         mySocket2->bind(QHostAddress::LocalHost,9876);
+         mySocket2->bind(QHostAddress::Any,9876);

 

change it to Any - and I see data in my packet sniffer...

 

hope this helps!

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition

Re: All Sockets (TCP/UDP) tutorials don't work on my BB10 Dev alpha device

It works :smileyhappy:

 

Thank you very much for your support.

 

I also managed to communicate with my current server developped by Java using UDP :smileyhappy:

When you are young, work to learn. Not to earn !