Lines 20-25
Link Here
|
20 |
import java.io.IOException; |
20 |
import java.io.IOException; |
21 |
import java.net.BindException; |
21 |
import java.net.BindException; |
22 |
import java.net.InetAddress; |
22 |
import java.net.InetAddress; |
|
|
23 |
import java.net.InetSocketAddress; |
23 |
import java.net.ServerSocket; |
24 |
import java.net.ServerSocket; |
24 |
import java.net.Socket; |
25 |
import java.net.Socket; |
25 |
import java.util.concurrent.Executor; |
26 |
import java.util.concurrent.Executor; |
Lines 261-266
Link Here
|
261 |
public ServerSocketFactory getServerSocketFactory() { return serverSocketFactory; } |
262 |
public ServerSocketFactory getServerSocketFactory() { return serverSocketFactory; } |
262 |
|
263 |
|
263 |
|
264 |
|
|
|
265 |
/** |
266 |
* Unlock timeout. |
267 |
*/ |
268 |
protected int unlockTimeout = 250; |
269 |
public int getUnlockTimeout() { return unlockTimeout; } |
270 |
public void setUnlockTimeout(int unlockTimeout) { |
271 |
this.unlockTimeout = unlockTimeout; |
272 |
} |
273 |
|
274 |
|
264 |
public boolean isRunning() { |
275 |
public boolean isRunning() { |
265 |
return running; |
276 |
return running; |
266 |
} |
277 |
} |
Lines 617-632
Link Here
|
617 |
*/ |
628 |
*/ |
618 |
protected void unlockAccept() { |
629 |
protected void unlockAccept() { |
619 |
Socket s = null; |
630 |
Socket s = null; |
|
|
631 |
InetSocketAddress saddr = null; |
620 |
try { |
632 |
try { |
621 |
// Need to create a connection to unlock the accept(); |
633 |
// Need to create a connection to unlock the accept(); |
622 |
if (address == null) { |
634 |
if (address == null) { |
623 |
s = new Socket(InetAddress.getByName("localhost").getHostAddress(), port); |
635 |
saddr = new InetSocketAddress("localhost", port); |
624 |
} else { |
636 |
} else { |
625 |
s = new Socket(address, port); |
637 |
saddr = new InetSocketAddress(address,port); |
626 |
// setting soLinger to a small value will help shutdown the |
|
|
627 |
// connection quicker |
628 |
s.setSoLinger(true, 0); |
629 |
} |
638 |
} |
|
|
639 |
s = new java.net.Socket(); |
640 |
s.setSoTimeout(soTimeout); |
641 |
s.setSoLinger(true ,0); |
642 |
if (log.isDebugEnabled()) { |
643 |
log.debug("About to unlock socket for: " + saddr); |
644 |
} |
645 |
s.connect(saddr, unlockTimeout); |
646 |
if (log.isDebugEnabled()) { |
647 |
log.debug("Socket unlock completed for:"+saddr); |
648 |
} |
630 |
} catch (Exception e) { |
649 |
} catch (Exception e) { |
631 |
if (log.isDebugEnabled()) { |
650 |
if (log.isDebugEnabled()) { |
632 |
log.debug(sm.getString("endpoint.debug.unlock", "" + port), e); |
651 |
log.debug(sm.getString("endpoint.debug.unlock", "" + port), e); |