public void run()
{
try {
SocketConnection sc = (SocketConnection)
Connector.open("socket://"+ serverAddress);
OutputStream os = null;
InputStream is = null;
System.out.println(sc.getLocalAddress());
os = sc.openOutputStream();
byte[] data = ("<ClientIP>"+sc.getLocalAddress()+"</ClientIP>GetModemsEND").getBytes();
os.write(data);
os.flush();
os.close();
is = sc.openInputStream();
int ch = 0;
StringBuffer sb = new StringBuffer();
System.out.println("connect");
while ((ch = is.read()) != '/'){
System.out.println(ch);
sb.append((char)ch);
}
System.out.println(sb.toString());
component1 = new StringItem(null, sb.toString());
String res = sb.toString() ;
component1 = new StringItem(null, res);
this.form.setTitle("Modems List:");
this.form.append(component1);
try{
this.form.append(image);
}catch(Exception e){
System.err.println("not found pic");
}
synchronized (this)
{
this.inProgress = false;
}
}
catch (ConnectionNotFoundException e)
{
this.form.append("Connection Not Found!");
}
catch (IOException e)
{
this.form.append(e.getMessage());
}
}
پیغام خطاش اینه:
error occured whilst opening connection
گوشی رو تست کردم به اینترنت وصل می شه. ولی نمی دونم مشکلش از کجاس...
بازم ممنون که جواب منو دادین.