BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-04-2006, 12:04 AM   #1
Wira
New Member
 
Join Date: Dec 2006
Model: 7100T
Posts: 1
Default Error in reopening socket connection

Please Login to Remove!

hii guys..

I have a menu which will do this process every time user click it.
- ask user to type text
- open socket connection to server
- send the text to server
- close connection

i'am not using the BES, just connect directly to a web server, so i use deviceside=true parameter.
Code:
iSocket = (StreamConnection)Connector.open("socket://" + iServerName+ ":" + iPort + ";deviceside=true");
at the first user click this menu, the process works fine, but when the user click it again, its not working. The process will halt in the Connector.open statement for about 2 minutes and then throw exception "Unable to open connection".

i have try to debug my code, and i found that if i open connection and just read from socket it works fine on my process above, but if i open connection and try to write data to socket, it only success on the first time, the next will be fail in opening connection statement.

this is the code for read from socket:
Code:
iEngine.iSockOutputStrm.write((new String(iTransferBuffer)).getBytes());
iEngine.iSockOutputStrm.flush();
guys, please help me fix this error... thanks..
FYI, i'am testing it on emulator.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Brand New STMicroelectronics M4T28-BR12SH1 TIMEKEEPER SNAPHAT Battery picture

Brand New STMicroelectronics M4T28-BR12SH1 TIMEKEEPER SNAPHAT Battery

$16.49



BLF188XR RF Power LDMOS Transistor High Frequency Microwave Tube picture

BLF188XR RF Power LDMOS Transistor High Frequency Microwave Tube

$118.56



50 Pcs S8050 General Purpose NPN Transistor TO-92 40V 800ma 100Mhz USA Shipping picture

50 Pcs S8050 General Purpose NPN Transistor TO-92 40V 800ma 100Mhz USA Shipping

$4.89



10 Pcs MPSH10 MPS-H10 650Mhz VHF / UHF RF Transistors ~ Fast USA Shipping picture

10 Pcs MPSH10 MPS-H10 650Mhz VHF / UHF RF Transistors ~ Fast USA Shipping

$5.69



TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor  picture

TO-92 Assortment NPN PNP DIY kit 15 value 600pcs Transistor

$11.52



MOSFET - IRF540N 100V 33A - Transistor for Arduino Pi TT picture

MOSFET - IRF540N 100V 33A - Transistor for Arduino Pi TT

$49.72







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.