fixed dynamic port allocation

This commit is contained in:
Matej Sekoranja committed 2011-03-03 13:07:28 +01:00
1 parent 911a1368b0
commit d8fd120578
2 files changed
+4 -2

No files matched your search

@@ -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));
+1 -2
View File
@@ -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);
}