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
Developer
stefano
Posts: 51
Registered: ‎08-07-2008
My Device: Not Specified

socket connection doesn't work

I've problems using socket connection.I used this line

 

sc = (SocketConnection)Connector.open("socket://"+_cfgHost+":"+_cfgPort+ ";deviceside=true",Connector.READ_WRITE);

 

my server for now is into my LAN. the addres server is 192.168.1.101

the address phone is 192.168.1.4. Both I can ping, from server to phone and from phone to server

 

I tried also but doesn't work:

sc = (SocketConnection)Connector.open("socket://"+_cfgHost+":"+_cfgPort+ ";deviceside=false",Connector.READ_WRITE); 

 

the  Connector.open doesn't go ahead is blocked.

 

I tried also socketdemo, server and phone app, present into jde 4.5.0

 

haa missing....on emulator this work:

sc = (SocketConnection)Connector.open("socket://"+_cfgHost+":"+_cfgPort+ ";deviceside=true",Connector.READ_WRITE); 

 

thanks

Please use plain text.
Administrator
MSohm
Posts: 14,314
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: socket connection doesn't work

It looks like you are trying to connect to an private IP address.  Have you tried using a public IP address?

 

When using deviceside=true, the connection is routed over the carrier's network.  This means that the connection needs to flow over their network, the Internet and come in through your firewall to the destination.

 

When using deviceside=false, the connection is routed through your BlackBerry Enterprise Server and can come out within your Intranet.  Note that his does require the BlackBerry be connected to a BlackBerry Enterprise Server.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
stefano
Posts: 51
Registered: ‎08-07-2008
My Device: Not Specified

Re: socket connection doesn't work

I did other test.. . Yes on an external address IP and using the carrier connection, it work. But if I disable the carrier connection and mantain only wifi, it doesn't work.

 

for wifi must I specify some other option, into string connection ?

 

thanks

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: socket connection doesn't work

You are correct, you need:

 

;interface=wifi

 

That is all.

 

Review the following video for more info on this and other network options:

http://www.blackberry.com/DevMediaLibrary/view.do?name=network

Please use plain text.