in jdk1.4java.net
Interface SocketOptions
SO_TIMEOUT
public static final int SO_TIMEOUT
Set a timeout on blocking Socket operations:
ServerSocket.accept();
SocketInputStream.read();
DatagramSocket.receive();
The option must be set prior to entering a blocking operation to take effect. If the timeout expires and the operation would continue to block, java.io.InterruptedIOException is raised. The Socket is not closed in this case. Valid for all sockets: SocketImpl, DatagramSocketImpl
See Also:
Socket.setSoTimeout(int), ServerSocket.setSoTimeout(int), DatagramSocket.setSoTimeout(int), Constant Field Values
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货