Relationship between server ports and connections and applications

Source: Internet
Author: User

1. The server has 65,535 ports, which is the variable that records the server port, is two bytes and is a short int. Its two-byte storage space determines that it can only open 65535 ports.

2. What is the port for? The port is used to listen for TCP connections. That is, the client HTTP connection is communicated using the IP address + server port number.

3. That the client comes in HTTP connection request, who will listen to the server port? Is the application, similar to the software such as Tomcat.

4. The serversocket of the application has the bind () method, which binds to the specified port of the server. The ServerSocket then accepts the request from the client using the Accept () method.

This is the port that the client sends (server IP address + server port number)----> server-side Program call Code serversocket.accept () listens on the server. This allows the client to establish a connection to the server-side application.

5. Port number and TCP connection number a little relationship!!! The specific number of TCP connections, which are fully connected by serversocket.accept ().

Serversocket.accept () Each time a connection is established, the port number of the binding refers to the client's port number, so that the data is returned to the client's application.

6. The number of TCP connections that can be accommodated by a tomcat is completely related to server performance and can be tens of thousands of. Not 500, 500 refers to Tomcat to build up to 500 threads, traditional bio communication threads.

7. Today's tomcat communication can hold tens of thousands of concurrent.

Relationship between server ports and connections and applications

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.