After all data operations are completed, you can call the close () function to release the socket and stop any data operations on the socket:Close (sockfd );
You can also call the shutdown () function to close the socket. This function allows you
What is socket
A socket interface is an API of a TCP/IP network. A socket interface defines many functions or routines. programmers can use it to develop applications on a TCP/IP network. To learn TCP/IP network programming on the internet, you
If the server and client have established a connection, the server calls close and sends the fin segment to the client (in fact, it may not necessarily send the fin segment, which will be discussed later ), at this time, the server can no longer
Client Side
server side
(1) invokes shutdown (S, sd_send) to signal end of session and that client has no more data to send.
(2) es fd_close, indicating graceful shutdown in progress and that all data
What is the SocketSocket interface is the TCP/IP network API, the Socket interface defines many functions or routines, programmers can use them
What is SocketA Socket interface is an API of a TCP/IP network. a Socket interface defines many functions
Image Description of the SOCKET protocol
The original meaning of socket is "hole" or "socket ". Here we use the 4bds UNIX Process
Information mechanism, take the latter meaning. Socket is very similar to a telephone outlet. Take a national-level
For a TCP connection, there are generally 2 ways to turn it off in the C language:
Close (SOCK_FD);
or
shutdown (sock_fd, ...);
In most cases the effect of these 2 methods is no different and can be used interchangeably. Except: Close () is an
What is socketA socket interface is an API of a TCP/IP network. A socket interface defines many functions or routines that can be used by programmers to develop applications on a TCP/IP network. To learn TCP/IP network programming on the internet,
what is socket the socket interface is a TCP/IP network API. The SOCKET interface defines many functions or routines, Program personnel can use them to develop applications on TCP/IP networks. To learn TCP/IP network programming on the internet,
Network Socket data transmission is a special type of I/O, and Socket is also a file descriptor. Socket also has a function called Socket () similar to opening a file. This function returns an integer Socket descriptor, and subsequent connection
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.