In common language we can say that the sockets are just like an end-point of two-way communication link over the network between two programs. Socket classes are used to establish a connection between client program and a server program. In java there is a java.net package, which provides two types of classes- first is ordinary socket, which implement the client side connection and second is server socket, which implement the server side connection.
In Java there are many socket class that is used for creating a Server applications. ServerSockets are quite different from normal Sockets. The main work of ServerSocket class is to wait for a request of connection by the client and connect them on published ports and then possibly returns a result to the requester. The SocketImpl is a common superclass of all classes that actually implement sockets. It is used to create both client and server sockets.
|
|
| ServerSocket(int port) |
Creates server socket on the specified port with a queue length of 50. |
|
ServerSocket(int port, int maxQueue) |
Creates a server socket on the specified port with a maximum queue length of maxQueue. |
|
ServerSocket(int port, int maxQueue, InetAddress localAddress) |
Creates a server socket on the specified port with a maximum queue length of maxQueue. On a multihomed host, localAddress specifies the IP address to which this socket binds. |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Server Sockets
Post your Comment