310634
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1613 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
9c8160db02
commit
9f62516c58
|
@ -212,8 +212,8 @@ public interface Connector extends LifeCycle
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @return The actual port the connector is listening on or -1 if there
|
||||
* is no port or the connector is not open.
|
||||
* @return The actual port the connector is listening on or
|
||||
* -1 if it has not been opened, or -2 if it has been closed.
|
||||
*/
|
||||
int getLocalPort();
|
||||
|
||||
|
|
|
@ -75,6 +75,9 @@ public class SocketConnector extends AbstractConnector
|
|||
_serverSocket= newServerSocket(getHost(),getPort(),getAcceptQueueSize());
|
||||
_serverSocket.setReuseAddress(getReuseAddress());
|
||||
_localPort=_serverSocket.getLocalPort();
|
||||
if (_localPort<=0)
|
||||
throw new IllegalStateException("port not allocated for "+this);
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
|
@ -210,7 +210,7 @@ public class SelectChannelConnector extends AbstractNIOConnector
|
|||
_acceptChannel.socket().bind(addr,getAcceptQueueSize());
|
||||
|
||||
_localPort=_acceptChannel.socket().getLocalPort();
|
||||
if (_localPort==-1)
|
||||
if (_localPort<=0)
|
||||
throw new IOException("Server channel not bound");
|
||||
|
||||
// Set to non blocking mode
|
||||
|
|
Loading…
Reference in New Issue