BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-01-2010, 09: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

Genuine OEM Dell 3200MP Osram Replacement Lamp & Housing 310-2328
$79.99
Genuine OEM Dell 3200MP Osram Replacement Lamp & Housing  310-2328 pictureFactory OEM Dell Power Supply DC Output 160W Model #PS-5161-1D1
$7.0
Factory OEM Dell Power Supply DC Output 160W Model #PS-5161-1D1 pictureGenuine OEM Dell RF223 High Yield Toner Cartridge CN-0RF223 5,000 18115dn NIB
$28.0
Genuine OEM Dell RF223 High Yield Toner Cartridge CN-0RF223 5,000 18115dn NIB picture(J158) Dell 130w PA-4E OEM (DA130PE1-00) Genuine Laptop AC Power Adapter
$25.0
(J158) Dell 130w PA-4E OEM (DA130PE1-00) Genuine Laptop AC Power Adapter pictureOEM Original Philips UHP 210/160W 0.9 Projector Bare Lamp For Dell 1510X/1610HD
$25.0
OEM Original Philips UHP 210/160W 0.9 Projector Bare Lamp For Dell 1510X/1610HD picture






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