tm.setSoTimeout(connectTimeout);
tm.setTcpNoDelay(tcpNoDelay);
tm.setConnectionMonitors(connectionMonitors);
try {
TimeoutToken token = null;
if(kexTimeout > 0) {
final Runnable timeoutHandler = new Runnable() {
public void run() {
synchronized(state) {