KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How does read(buffer, offset, length) actually work, if i pass the length to read as 32, does that mean that it would keep blocking till it receives the 32 bytes? I understand it would return and exception or 0 in case of socket exception or if the connection is closed, respectively. what if the sender only sends 31 bytes , would read continue to block? if that is true, does it mean that read would always return the integer that is equal to length passed to it? and also how cnan i control the timeout if the remaining 1 byte does not come after certain time. Important and yet not answered In contrast, what if the sender sends 32 byte , does that assure that read would block until all 32 are received or can it come out without reading all the 32 bytes.
Tags (comma-separated)
Save Edits
Cancel