Socket Coarse Solution

Source: Internet
Author: User

Baidu definition: The network of two programs through a two-way communication connection to achieve the exchange of data, one end of this connection is called a socket.

Socket Communication Process:

The two programs on the network realize the exchange of data through a two-way communication connection, one end of this connection is called a socket.

Server creates sockets based on address type (IPV4,IPV6), socket type, protocol

Server binds IP address and port number to socket

Server socket Listener Port number request, ready to receive the client's connection, this time the server socket is not opened

Client creates socket

Client opens socket, attempts to connect to server socket based on server IP address and port number

The server socket receives a client socket request, passively opens, and begins receiving client requests until the client returns the connection information. When the socket enters the blocking state, the so-called blocking is the Accept () method until the client returns the connection information, and begins receiving the next client understanding request

Client connection successful, sending connection status information to server

Server Accept method returned, connection successful

The client writes information to the socket

Server Read information

Client shutdown

Server-side shutdown

Socket Coarse Solution

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.