Javatpoint Logo
Javatpoint Logo

Java ServerSocket getSoTimeout() Method

The getSoTimeout() method of ServerSocket class is used to enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

If the timeout expires, a java.net.SocketTimeoutException is raised, though the ServerSocket is still valid.

Syntax

Returns:

The SO_TIMEOUT value

Throws:

IOException - if an I/O error occurs

Since:

1.1

Example 1

ServerApplication:

ClientApplication:

Output:

Java ServerSocket getSoTimeout() Method Java ServerSocket getSoTimeout() Method

Example 2

ServerApplication:

ClientApplication:

Java ServerSocket getSoTimeout() Method
Java ServerSocket getSoTimeout() 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