-
April 15th, 2010, 12:14 PM
#1
[RESOLVED] Read returns 0 or -1 (while data are present)
Hello everybody,
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,
Mathieu
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|