KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The recv() library function man page mention that: It returns the number of bytes received. It normally returns any data available, up to the requested amount, rather than waiting for receipt of the full amount requested. If we are using blocking recv() call and requested for 100 bytes: recv(sockDesc, buffer, size, 0); /* Where size is 100. */ and only 50 bytes are send by the server then this recv() is blocked until 100 bytes are available or it will return receiving 50 bytes. The scenario could be that: server crashes after sendign only 50 bytes bad protocol design where server is only sending 50 bytes while client is expecting 100 and server is also waiting for client's reply (i.e. socket close connection has not been initiated by server in which recv will return) I am interested on Linux / Solaris platform. I don't have the development environment to check it out myself.
Tags (comma-separated)
Save Edits
Cancel