"Java Network Stream"

Source: Internet
Author: User

First, ServerSocket

Java.lang.Object

|-java.net.serversocket

There are sub-categories Sslserversocket.

This class implements a server socket. The server socket waits for the request to pass through the network. It performs certain actions based on the request, and may then return the results to the requestor.

Common construction Methods:

ServerSocket(int port)
Creates a server socket bound to a specific port.

Common methods:

 socket Accept ()
            listens for and accepts connections to this socket.
  ; void bind (socketaddress endpoint)
            binds ServerSocket to a specific address (IP address and port number).
 void close()
Close the socket.

 inetaddress getinetaddress ()
            returns the local address of this server socket.
  ; int getlocalport ()
            returns the port on which this socket listens.
  ; SocketAddress getlocalsocketaddress ()
            returns the address of the endpoint bound by this socket and returns null if it is not already bound.

Java Network flow

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.