Computer network-socket Overview

Source: Internet
Author: User

(1) socket Concept

For inter-network process communication, the two processes must be uniquely identified. The "ip address" at the network layer can uniquely identify the network host. The "IP + port" at the transport layer can uniquely identify the two processes on the network.

After two processes are identified, socket is usually used for communication.

The socket originated from UNIX and continued the concept of "Everything is a file". It uses the "Open-read-write-close" file operation method.

Shows the relationship between the socket layer and the application layer.



(2) socket communication process

Server: socket-> bind-> listen-> Accept-> receive-> close

Client: socket-> connect-> send-> close

The server needs to obtain the IP address and the bound port number for the client to call. Therefore, bind and listern are required. The client port number is bound to the port number during connect.



(3) socket connection establishment process

Establish a connection with the three-way handshake of TCP/IP


Using the packet capture tool, you can see the three handshakes of my visit to the blog http://blog.csdn.net/wangpeifeng669.



(4) socket release process

Release connections four times


For Java Socket Connection demo, refer to here

From:

Http://blog.csdn.net/dlutbrucezhang/article/details/8577810

Http://www.cnblogs.com/dolphinX/p/3460545.html

Computer network-socket Overview

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.