Java-based HTTP server

Source: Internet
Author: User

1.java.net.socket Java.net.ServerSocket

2. In HTTP, it is always the client that begins a transaction by establishing a connection and sending an HTTP request. The Web server does not need to contact the client or make a callback connection to the client. Both the client and the server can terminate the connection prematurely.

3. An HTTP request consists of three components

Method--uri--Protocol/version

The requested header

Main content

URIs are usually interpreted relative to the server root, so always a slash/start.

The 4.accept method returns only when there is a connection request, and returns an instance of the socket class.

Java-based HTTP server

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.