简体   繁体   中英

Non-blocking sockets and send()

Based on my underestimating of non-blocking sockets, when I want to send() data, if the send buffer is full, send() will return an error. But my question is the following:

If the send buffer has room for 5 bytes, and I tried to send 15 bytes, will the entire 15 bytes not be send, or will 5 bytes be send, and it's my responsibility to see how much data were actually sent, and re-send the remaining bytes.

You will be told by send how many bytes where sucessfully sent and it's totally your responsibilty to handle anything not sent. But there are plenty of libraries that will help you in this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM