Javatpoint Logo
Javatpoint Logo

Java ServerSocket getRemoteSocketAddress() Method

The getRemoteSocketAddress() method of ServerSocket class uses to return the address of the socket endpoint to which it connected. If it is not connected, then it returns null.

Syntax

Returns:

A SocketAddress representing the remote endpoint of this socket, or null if it is not connected yet.

Since:

1.4

Example 1

Output:

Java ServerSocket getRemoteSocketAddress() Method

Example 2

ServerApplication:

ClientApplication

Output:

Java ServerSocket getRemoteSocketAddress() Method
Java ServerSocket getRemoteSocketAddress() Method
Next TopicJava ServerSocket





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA