try { sock.connect(host, port, 3000);} catch(e) { sock.close();}
try { sock.connect(host, port, 3000); } catch(e) { sock.close(); }