Using Server Sockets
Creating a server socket :
- public ServerSocket(int port).
Creates a server socket that listens on a local port :
- public ServerSocket(int port,int backlog).
-
Accepting and closing connections :
- public Socket accept() -> waits for connection.
- public void close() -> closes the socket.
-
Other methods :
- public InetAddress getInetAddress()->Get client address.
- public int getLocalPort() -> Get the client local port.