lundi 2 mars 2015

Client-Server application in Java - unexplained behaviour



I started to learn about server-client application and I used this Java code example for client and server:


http://ift.tt/1Gdc9rZ http://ift.tt/1Gdc73w


I ran both applications on two instances of Eclipse.


The code remain the same, except for the change:



//out.println(inputLine);
System.out.println(inputLine);


In the server side. And to the printings "Hello", "Bye" in the beginning and end of the main() in the server-side. And of course, I set the IP used by the Client to the IP of my computer (used ipconfig - not unique IP)


From what I understand, everything the client sends should appear on the server standard output (unless I understand wrong).


here is the input I wrote in the client side:



boooooooooo
baaaaaa
paaaaaaa


And this is what I get in the Server-side:



Hello
boooooooooo


Something in here is unexpected to me- the server seem to run in the main(), but from some reason after the first printing it stops.




Aucun commentaire:

Enregistrer un commentaire