April 15th, 2010, 12:14 PM
[RESOLVED] Read returns 0 or -1 (while data are present)
I'm not a socket expert but I have some experience with serial ports I/O under linux...
I am working on client/server project for a home-brew protocol. There was a previous implementation of the client and the server but I have to make a cleaner one. We use the BSD sockets.
On the client side I have to send a message (which is OK) and then wait for the header of the response. The header is a 16 bytes structures.
I use select to wait for data. select returns 1 indicating that there is data to read... However, read() always returns -1 or 0.
I have absolutely no idea of what is going on... Any help would be appreciated.
Thanks in advance,
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!