Java ServerSocket getLocalSocketAddress() MethodThe getLocalSocketAddress() method of ServerSocket class returns the address of the endpoint to which this socket is bound to, otherwise returns null if it is not bound yet. If the socket was bound before being closed, then this method will continue to return the address of the endpoint after the socket is closed. SyntaxReturns:A SocketAddress representing the local endpoint of this socket, or null if it is not bound yet. Since:1.4 Example 1ServerApplication: ClientApplication: Output: Example 2
Next TopicJava ServerSocket
|