(socket servers) merge the ConnectionInfo class with the ConnectionState one, which simplify all the server apis

This commit is contained in:
Benjamin Sergeant
2020-08-28 14:55:40 -07:00
parent 629c155044
commit 73b9c0b89b
25 changed files with 97 additions and 123 deletions

View File

@ -61,11 +61,10 @@ namespace snake
_server.setOnClientMessageCallback(
[this](std::shared_ptr<ix::ConnectionState> connectionState,
ix::ConnectionInfo& connectionInfo,
ix::WebSocket& webSocket,
const ix::WebSocketMessagePtr& msg) {
auto state = std::dynamic_pointer_cast<SnakeConnectionState>(connectionState);
auto remoteIp = connectionInfo.remoteIp;
auto remoteIp = connectionState->getRemoteIp();
std::stringstream ss;
ss << "[" << state->getId() << "] ";