From 7a43f6be09cfe74dc4a757e949ba88ce033ac419 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 25 Sep 2012 08:23:19 +0000 Subject: Sockets are now owned by SocketThreads instead of ClientHandle (FS #246 and FS #247) git-svn-id: http://mc-server.googlecode.com/svn/trunk@891 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Server.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/Server.cpp') diff --git a/source/Server.cpp b/source/Server.cpp index c77892076..8cf923882 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -113,27 +113,27 @@ void cServer::NotifyClientWrite(const cClientHandle * a_Client) -void cServer::WriteToClient(const cSocket * a_Socket, const AString & a_Data) +void cServer::WriteToClient(const cClientHandle * a_Client, const AString & a_Data) { - m_SocketThreads.Write(a_Socket, a_Data); + m_SocketThreads.Write(a_Client, a_Data); } -void cServer::QueueClientClose(const cSocket * a_Socket) +void cServer::QueueClientClose(const cClientHandle * a_Client) { - m_SocketThreads.QueueClose(a_Socket); + m_SocketThreads.QueueClose(a_Client); } -void cServer::RemoveClient(const cSocket * a_Socket) +void cServer::RemoveClient(const cClientHandle * a_Client) { - m_SocketThreads.RemoveClient(a_Socket); + m_SocketThreads.RemoveClient(a_Client); } @@ -340,8 +340,8 @@ void cServer::StartListenClient() LOG("Client \"%s\" connected!", ClientIP.c_str()); - cClientHandle *NewHandle = new cClientHandle(SClient, m_ClientViewDistance); - if (!m_SocketThreads.AddClient(&(NewHandle->GetSocket()), NewHandle)) + cClientHandle * NewHandle = new cClientHandle(&SClient, m_ClientViewDistance); + if (!m_SocketThreads.AddClient(SClient, NewHandle)) { // For some reason SocketThreads have rejected the handle, clean it up LOGERROR("Client \"%s\" cannot be handled, server probably unstable", SClient.GetIPString().c_str()); -- cgit v1.2.3