I've been reading the man page for read(2) and according to the man page, the return value of read(2) is -1 on error, 0 on EOF, and > 0 for the number of bytes read.
How do I tell when the write(2) on the client is finished ?
I ask because I'm writing a server and a client to test it, but when I read(2) the first time and loop around to check for more, read(2) blocks and waits for another write(2) from the client (which isn't coming because my client only has the one write(2)).
If I'm just missing something simple, could somebody kindly point it out or point me to a good reference ?