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

New Contributor
Posts: 2
Registered: ‎06-15-2012
My Device: 9800
My Carrier: UMobile

wifi socket connection can' t send data

[ Edited ]

Hi guys,


Below are my code , currently i have problem sending out data to the server from blackberry device.

on, i able to know that when is the blackberry device connect or disconnect but can' t receive the data

which send from blackberry device , by the way i didn' t sign with keys for the device(i assume the code should be working without signing it).


Any ideas what happenning ??



-----blackberry device (blackberry torch)--------------------------------------------

URL = "socket://;deviceside=true;interface=wifi");

conn = (StreamConnection)Connector.open(URL);

os = conn.openOutputStream();                                   //when execute this line,  listen.accept() on server return socket

osw = new OutputStreamWriter(os);

osw.write("test");                                                          //server can' t receive this data


osw.close();                                                                  //when execute this line, sockProc.isConnected() return false




----server( using java )----------------------------------------------------


ServerSocket listen = new ServerSocket(44444,backlog,InetAddress.getLocalHost());

sockProc = listen.accept();

BufferedReader in = new BufferedReader(new InputStreamReader (sockProc.getInputStream()));

while(true)   {        


                clientrply =in.readLine();     








Posts: 17,004
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: wifi socket connection can' t send data

[ Edited ]

remove the deviceside=true. interface=wifi is sufficient for a wifi connection. (edit: it seems that it does not matter)

is the missing 4 on the server port a typo?

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
New Contributor
Posts: 2
Registered: ‎06-15-2012
My Device: 9800
My Carrier: UMobile

Re: wifi socket connection can' t send data

[ Edited ]

Sorry, it's typo. It should be ServerSocker(44444 

I had edit the post , thx  


by the way, removing the "deviceside=true" doesn't fix anything