Update mc_tcp.cpp

This commit is contained in:
Eao3piq4e 2022-08-10 16:25:37 +08:00
parent d0a5914e3f
commit 3a2a690ee8
1 changed files with 8 additions and 4 deletions

View File

@ -236,7 +236,8 @@ static void mc_tcp_do_listen(int fd, int backlog)
/*
function name: mc_tcp_read_block
description: This function receives data from the other end of TCP in a blocking manner.
description: This function receives data from the other end of TCP in a blocking manner, the receiving
process will not end until the data of size byte length is successfully received or a real error occurs in the receiving process
arguments: The first argument indicates the specific socket that has been established.
The second argument is a pointer to memory area, we use it to store received data.
The third argument is byte length of the memory area pointed to by the data pointer.
@ -319,7 +320,8 @@ int mc_tcp_read_block(int fd, void* data, int size, int flags)
/*
function name: mc_tcp_read_nonblock
description: This function receives data from the other end of TCP in a non blocking manner.
description: This function receives data from the other end of TCP in a non blocking manner,
the data receiving process is only performed once.
arguments: The first argument indicates the specific socket that has been established.
The second argument is a pointer to memory area, we use it to store received data.
The third argument is byte length of the memory area pointed to by the data pointer.
@ -450,7 +452,8 @@ int mc_tcp_check_socket(int sock)
/*
function name: mc_tcp_write_block
description: This function writes data to the specified socket in blocking mode.
description: This function writes data to the specified socket in blocking mode, the sending process
will not end until all the data are successfully sent or a real error occurs during the sending process
arguments: The first argument indicates the specific socket that has been established.
The second argument is a pointer to memory area, we use it to store data to be sent.
The third argument is byte length of data to be sent.
@ -520,7 +523,8 @@ int mc_tcp_write_block(int fd, const void* data, int size)
/*
function name: mc_tcp_write_noblock
description: This function writes data to the specified socket in non blocking mode.
description: This function writes data to the specified socket in non blocking mode,
the data transmission process is only performed once.
arguments: The first argument indicates the specific socket that has been established.
The second argument is a pointer to memory area, we use it to store data to be sent.
The third argument is byte length of data to be sent.