BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-01-2010, 08:16 AM   #1 (permalink)
New Member
 
Join Date: Dec 2010
Model: bold
PIN: N/A
Carrier: att
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default TCP / IP Listener

Please Login to Remove!

I am trying to create a TCP / IP Listener on an application on the BlackBerry Bold to listen to a specific ip address and port on a pc. From what I've gathered from reading from posts, is that the listener on my handheld will probably be disconnected after 2-3 min of no activity. So I would need to create some sort of "pulse" or "heartbeat" every so often back to the pc. Am I right in this assumption?

Also, The pc is needing some sort of acknowledgement that I'm trying to, or have connected to listen. Below is the code that I use to create the listener. Using this code, will it send or create some sort of data packet that the application on the pc will see or know that I'm trying to listen in on that ip address and port??


while (!_stop) {
try {
String URL = "socket://"+ip+":"+port+";deviceside=true";
_conn = (StreamConnection)Connector.open(URL);
_in = new InputStreamReader(_conn.openInputStream());
while (!_stop) {
StringBuffer sb = new StringBuffer();
int datum = -1;
while ( -1 != (datum = _in.read()) ) {
sb.append((char)datum);
}
notifyListeners((sb.toString()));
}
} catch (IOException e) {
System.err.println(e);
}
}
Thanks in advance for your input.
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: TCP / IP Listener
Thread Thread Starter Forum Replies Last Post
8900 Wi-Fi Issues?? matthiasj General 8900 Series Discussion - Javelin 19 08-20-2009 02:33 PM
berry411 Wont work aka General 8300 Series Discussion - Curve 2 10-14-2008 09:41 PM
BES server that was configured at another site seems to require that site to work mannyp BES Admin Corner 7 07-05-2007 08:48 PM





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