BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-12-2005, 12:15 PM   #1 (permalink)
New Member
 
Join Date: Jul 2005
Model: 8800
Carrier: Cingular
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with socket connection

Please Login to Remove!

Hi there! I've been trying to find samples with Socket Connections but with no success. Can anyone here provide a very simple client side sample that'll connect to an address:port? Thanks!

If you know of a place where I can look it up then please provide the web address.
Offline  
Old 11-01-2005, 02:07 PM   #2 (permalink)
New Member
 
Join Date: Nov 2005
Model: 7100g
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

class prueba {

private String URL= "socket://10.2.1.2:4444;deviceside=true";
int len;
public static void main(String[] args)
{
prueba _prueba = new prueba();
}

public prueba() {
try{
StreamConnection conn = null;
conn = (StreamConnection)Connector.open(URL);
InputStream input = conn.openInputStream();
byte[] data = new byte[256];
char caracter;
char[] prueba = new char[256]; long i =1;

while(-1 != (len = input.read(data))){
System.out.println(String.valueOf(i));
i++;
}
}catch (Exception e){
System.out.println(e.toString());
}

}
}


I hope it helps you
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

Sprague 6PS-25 .25 uF 600 Volt Orange Drop CAPACITOR Guitar Amp Tone X 2
$14.99
Sprague 6PS-25 .25 uF 600 Volt  Orange Drop CAPACITOR  Guitar Amp Tone  X 2 pictureSprague M39003/01-M2737J Capacitor
$19.99
Sprague M39003/01-M2737J Capacitor picture900 PCS SIEMENS .033MF 5% 250V CAPACITORS
$3.99
900 PCS SIEMENS .033MF 5% 250V   CAPACITORS picture(1)1000uf 200wv 65c Large Can Electrolytic Capacitor 104x35mm 41-39103-1
$10.0
(1)1000uf 200wv 65c Large Can Electrolytic Capacitor  104x35mm  41-39103-1 picture(1) Vintage Mallory 5000uf 20vdc 65c 41-33944-1 Large Can Electrolytic capacitor
$10.0
(1) Vintage Mallory 5000uf 20vdc 65c 41-33944-1 Large Can Electrolytic capacitor picture






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