synchronized(outgoing_mutex) { // serialize access with ConnectionEstablisher
if(established) {
return true;
}
try {
if(writer == null) writer=new TimedWriter();
// create a socket to remote:remote_port, bind to local address (choose any local port);
// outgoing=new Socket(remote, remote_port, local, 0); // 0 means choose any local port
outgoing=writer.createSocket(local, remote, remote_port, timeout);
outgoing.setSoLinger(true, 1); // 1 second // +++ ? needed ? it is off by default !