DatagramSocket.setSoTimeout

DatagramSocket.setSoTimeout

Class Overview | Class Members | This Package | All Packages

Syntax
public synchronized void setSoTimeout( int timeout ) throws SocketException
Description
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to receive() for this DatagramSocket will block for only this amount of time. If the timeout expires, a java.io.InterruptedIOException is raised, though the ServerSocket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.