fixed dynamic port allocation
This commit is contained in:
@@ -66,6 +66,9 @@ namespace epics {
|
||||
THROW_BASE_EXCEPTION(temp.str().c_str());
|
||||
}
|
||||
else {
|
||||
|
||||
epicsSocketEnableAddressReuseDuringTimeWaitState(_serverSocketChannel);
|
||||
|
||||
// try to bind
|
||||
int retval = ::bind(_serverSocketChannel,
|
||||
&_bindAddress.sa, sizeof(sockaddr));
|
||||
|
||||
@@ -143,8 +143,7 @@ void ServerContextImpl::internalInitialize()
|
||||
initializeBroadcastTransport();
|
||||
|
||||
_acceptor = new BlockingTCPAcceptor(this, _serverPort, _receiveBufferSize);
|
||||
//TODO fix this
|
||||
//_serverPort = _acceptor->getBindAddress()->ia.sin_port;
|
||||
_serverPort = ntohs(_acceptor->getBindAddress()->ia.sin_port);
|
||||
|
||||
_beaconEmitter = new BeaconEmitter(_broadcastTransport, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user