Hi
I am using Sockets for a TCP communication between a client and a server. First, the client sends some data, then the server
responds. The client can send ANY data, so I cannot define a termination signal like 255 or \n or such.
I am using read() on the InputStream of the Socket to read the data the client sends. When read
returns -1 I process the data and reply.
Now my problem is, that the server blocks in read() and I am not sure how to make it return -1, or how the
client can terminate the stream.
I found the method shutdownOutput, which sends a termination signal to the server and then read returns -1.
So when I use a Java Server and a Java Client, I use shutdown to signal that all data is send and it works.
But now I have to receive data from clients written in Delphi and C, and somehow I cant find ways to terminate the
server InputStream without closing the whole socket.
Did you ever build a TCP communication with other programming languages and how do you
organise request, response and end of transmission?
-JAW