I have just started learning socket programming in java. My programe has two part. one is client creates a message that is sended to server. Another is a server that recives the messages and then send back the message to client. it work but has a strange result. the first char in the message, for sample "123", that sended from client to server,at server side, it's removed, so the result is "23", again the recived messages are sended back to client, so the result at client ":23". I don't know result. has any one can help or explant ? thank you !
There are two probable reasons that I can think of: 1. The if you are using any buffer or an array for the i/o stream you are probably not flushing it. Check if the results vary. Rerun or call the sequence in a loop and read the data in a loop in the server side. 2. Or perhaps your code does not encode the data in the right charecter set. try encoding the data. This can be better clarified if you can paste the code. e.g. the type of OutPutStream object you are using and teh piece of code used to write to socket. I hope this helps!
[ June 18, 2002: Message edited by: Abhijit Kulkarni ]
<b><i>Abhijit</i></b> <br />---------------------------------<br />Give me my share of smile!
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop