DatagramSocket GetSoTimeout() Example
Retrieve setting for SO_TIMEOUT.
DatagramSocketclass GetSoTimeout() method example. This example shows you how to use GetSoTimeout() method.This method Retrieve setting for SO_TIMEOUT.
Here is the code:-
/**
* @Program that Returns the setting for SO_TIMEOUT
* GetSoTimeout.java
* Author:-RoseIndia Team
* Date:-20-jun-2008
*/
import java.net.*;
public class GetSoTimeout {
public static void main(String[] args) throws Exception {
DatagramSocket ds = new DatagramSocket();
ds.connect(new InetSocketAddress(9090));
System.out.println("Setting for SO_TIMEOUT is: " + ds.getSoTimeout());
}
} |
Output of the program:-
| Setting for SO_TIMEOUT is: 0 |
|