Socket getSoTimeout Example
Socket class getSoTimeout example. This example shows you how to use getSoTimeout method.
Socket class getSoTimeout example. public int getSoTimeout()
throws SocketException
Returns setting for SO_TIMEOUT. 0 returns implies that the option is disabled (i.e., timeout of infinity).
Here is the code
/*
* @ # GetSoTimeout.java
* A class repersenting use to getSoTimeout method
* of NumberFormat class in java.text package
* version 17 June 2008
* author Rose India
*/
import java.net.*;
public class GetSoTimeout {
public static void main(String args[]) throws Exception {
Socket socket = new Socket();
//Connects this socket to the server.
socket.connect(new InetSocketAddress("192.168.10.211", 8080));
System.out.println("SoTimeout " + socket.getSoTimeout());
//close socket
socket.close();
}
} |
|