> How I can send an EOF ? I tried "cL" or an empty string without success.
You send an EOF by closing the socket. There's really no such thing as an "EOF character" ... it's just something made up by a library to return when the end of the file/data is reached. It doesn't exist in the file or over the socket. If you're trying to send a file over a socket but leave the socket open after the file is sent, then you need some other mechanism to tell the server when the file is done. The easiest way is to send the length (in bytes) of the file first, and then the data. The server reads the length, then reads that many bytes and writes them to the file, and then it knows the file is over. You _could_ make up some special byte like 0x00 to send at the end of the file ... but that byte could occur in the file itself, so then you need a way to escape it so the server doesn't think the file is over yet ... and then you need a way to escape the escape character. It's rather messy, and it slows down sending and receiving because you have to scan through all the bytes.
