(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

@ -45,10 +45,9 @@ namespace ix
}
void RedisServer::handleConnection(std::unique_ptr<Socket> socket,
std::shared_ptr<ConnectionState> connectionState,
std::unique_ptr<ConnectionInfo> connectionInfo)
std::shared_ptr<ConnectionState> connectionState)
{
logInfo("New connection from remote ip " + connectionInfo->remoteIp);
logInfo("New connection from remote ip " + connectionState->getRemoteIp());
_connectedClientsCount++;

View File

@ -44,8 +44,7 @@ namespace ix
// Methods
virtual void handleConnection(std::unique_ptr<Socket>,
std::shared_ptr<ConnectionState> connectionState,
std::unique_ptr<ConnectionInfo> connectionInfo) final;
std::shared_ptr<ConnectionState> connectionState) final;
virtual size_t getConnectedClientsCount() final;
bool startsWith(const std::string& str, const std::string& start);