Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

socket programming/ multithreading

  Asked By: Lourdes    Date: Mar 13    Category: Java    Views: 960
  

can any body help me on socket
programming/ multithreading. i'm creating a program that accepts
connection and data from a palmpilot tungsten. i had difficulty in
receiving the data. i first use the

in = new BufferedReader(new InputStreamReader(socket.getInputStream
()));

but nothing happens.

then i use

is = new DataInputStream(clientSocket.getInputStream());

then i finally got the data from the palm pilot. but one problem is
that.....
String john;
while ((john = is.readLine()) != null) {
System.out.println("Server: " + john);
if (john.indexOf(john) != -1) {
break;
}
}
System.out.println("start if" + john);
if (john.equals("name")){
System.out.println("query"+john);
}
else{
System.out.println("nothing");
}

in the line if(john.equals("name"))...
the output is "nothing" meaning, there is no data in john.
can any body help me? thanks a lot.......

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on socket programming/ multithreading Or get search suggestion and latest updates.