示例#1
0
 /**
  * If the specified amount of time passes without receiving an object over TCP, the connection is
  * considered closed. When a TCP socket is closed normally, the remote end is notified immediately
  * and this timeout is not needed. However, if a socket is closed abnormally (eg, power loss),
  * KryoNet uses this timeout to detect the problem. The timeout should be set higher than the
  * {@link #setKeepAliveTCP(int) TCP keep alive} for the remote end of the connection. The keep
  * alive ensures that the remote end of the connection will be constantly sending objects, and
  * setting the timeout higher than the keep alive allows for network latency. Set to zero to
  * disable. Defaults to 12000.
  */
 public void setTimeout(int timeoutMillis) {
   tcp.timeoutMillis = timeoutMillis;
 }