(socket+websocket+http+redis+snake servers) expose the remote ip and remote port when a new connection is made (see #222) / only ipv4 is handled
This commit is contained in:
@ -307,6 +307,10 @@ namespace ix
|
||||
continue;
|
||||
}
|
||||
|
||||
// FIXME error handling
|
||||
char *remoteIp = inet_ntoa(client.sin_addr);
|
||||
auto connectionInfo = std::make_unique<ConnectionInfo>(remoteIp, client.sin_port);
|
||||
|
||||
std::shared_ptr<ConnectionState> connectionState;
|
||||
if (_connectionStateFactory)
|
||||
{
|
||||
@ -342,7 +346,7 @@ namespace ix
|
||||
_connectionsThreads.push_back(std::make_pair(
|
||||
connectionState,
|
||||
std::thread(
|
||||
&SocketServer::handleConnection, this, std::move(socket), connectionState)));
|
||||
&SocketServer::handleConnection, this, std::move(socket), connectionState, std::move(connectionInfo))));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user