看jdk的文档了:
setKeepAlive public void setKeepAlive(boolean on)
throws SocketException Enable/disable SO_KEEPALIVE.Parameters:on - whether or not to have socket keep alive turned on.Throws:SocketException - if there is an error in the underlying protocol, such as a TCP error.Since: 1.3See Also: getKeepAlive()
setKeepAlive public void setKeepAlive(boolean on)
throws SocketException Enable/disable SO_KEEPALIVE.Parameters:on - whether or not to have socket keep alive turned on.Throws:SocketException - if there is an error in the underlying protocol, such as a TCP error.Since: 1.3See Also: getKeepAlive()
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货