I have sent a String from client to server but when it receives to the server it doesn't print in the first time only in second time and don't know why.
Here is the code :
Client Side:
String str = "40D32DBBE665";
while (str != null) {
out.writeUTF(str);
}
Server Side:
String st="";
while(in.readUTF()!=null){ // it gets into the loop in the first time
System.out.println("Test"); // in the first time it prints this line
st = in.readUTF();
System.out.println(st);
}
So how I can receive it in the first time. Please help !!!
Thanks in advance :)
str- do it doesn't make sense to be in a loop checking the contents ofstr... as I say, a short but complete pair of programs would really help.