Re: 6.3 - Complete read without select()

6

From: Ilya

I am looking for some recommendation to handle situation as follows: select() says data is available to be read. I read 4096 bytes(this is size for socket receive buffer), parse buffer and see that there are 25 complete messages in buffer and part of the next message. I would like to read rest of uncompleted message without call select(). I would like call select only after I finished read rest of uncompleted message. Thanks

From: Tom

In answering Ilya's question, I would use the following approach to read message one by one (in this case, the messages are strings separate by NULL characters):