|
From: Vitor S. C. <vi...@bi...> - 2002-02-20 19:35:19
|
Hi Erick, Sorry for the delay, it took me a while to understand the problem. I hope this will still be useful. > I am trying to design a simple client-serveur example using sockets, but > the following one does not work. Could someone help me and tell me what > I did wrong? or could send me a working example? > I believe your problem is that you go too fast on the client. The client sends all the data and then closes the socket. In your case, it might happen that you close the socket before the server has had time to read all the data. When you close the socket on the client, the stream on the server side is closed by the Operating System and Yap on the server cannot ever read the last three lines. You need to force the client to wait for a while before you close the socket, maybe by asking the server to send a character at the end. > Thanks a lot in advance for your help and time, Again, my apologies for the delay in answering. > Best regards, > Erick. > Best regards, Vitor |