When send () returns in socket programming, what does this mean?

when send () returns, there are three possibilities:

1. data to be sent was copied to the kernel buffer

2. the data sent is sent to peers

3. data for sending were sent on an equal footing and received it

I'm really confused, I read some code snippets about the TCP / IP stack in a Linux source, and I found a path to the data stream:

when we use the send () function, it calls the sys_sendto () base function, and the sys_sendto () function uses send_msg () to do the work, and send_msg () goes to __send_msg () and finally __send_msg () calls scm_send (), which again uses its base function __scm_send ().

In general, the data stream works in this way:

send() ==> sys_sendto() ==> send_msg() ==> __send_msg() ==> scm_send() ==> __scm_send()

In the __scm_send () function, it copies data to the kernel buffer.

, , , , , - ?

+3
1

, , . . , , - TCP .

, , , , , - .

+4

Source: https://habr.com/ru/post/1766901/


All Articles