summaryrefslogtreecommitdiffstats
path: root/source/cSocketThreads.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-13 22:47:03 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-13 22:47:03 +0100
commit4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c (patch)
treefebea3ecd89c0d4aa83924e430bf11366d754733 /source/cSocketThreads.cpp
parentNew makefile with automatic *.cpp sourcefile import, automatic header file dependencies and switchable debug / release configuration. gnumake-specific :( (diff)
downloadcuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.gz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.bz2
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.lz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.xz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.zst
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.zip
Diffstat (limited to 'source/cSocketThreads.cpp')
-rw-r--r--source/cSocketThreads.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/cSocketThreads.cpp b/source/cSocketThreads.cpp
index 796316878..9d9258499 100644
--- a/source/cSocketThreads.cpp
+++ b/source/cSocketThreads.cpp
@@ -8,7 +8,7 @@
#include "Globals.h"
#include "cSocketThreads.h"
#include "cClientHandle.h"
-#include "packets/cPacket_RelativeEntityMoveLook.h"
+// #include "packets/cPacket_RelativeEntityMoveLook.h"
@@ -19,6 +19,7 @@
cSocketThreads::cSocketThreads(void)
{
+ LOG("cSocketThreads startup");
}
@@ -60,6 +61,7 @@ bool cSocketThreads::AddClient(cSocket * a_Socket, cCallback * a_Client)
if (!Thread->Start())
{
// There was an error launching the thread (but it was already logged along with the reason)
+ LOGERROR("A new cSocketThread failed to start");
delete Thread;
return false;
}
@@ -141,6 +143,17 @@ cSocketThreads::cSocketThread::cSocketThread(cSocketThreads * a_Parent) :
+cSocketThreads::cSocketThread::~cSocketThread()
+{
+ mShouldTerminate = true;
+ m_ControlSocket1.CloseSocket();
+ m_ControlSocket2.CloseSocket();
+}
+
+
+
+
+
void cSocketThreads::cSocketThread::AddClient(cSocket * a_Socket, cCallback * a_Client)
{
assert(m_NumSlots < MAX_SLOTS); // Use HasEmptySlot() to check before adding
@@ -310,6 +323,7 @@ bool cSocketThreads::cSocketThread::Start(void)
// Start the thread
if (!super::Start())
{
+ LOGERROR("Cannot start new cSocketThread");
m_ControlSocket2.CloseSocket();
return false;
}
@@ -383,8 +397,6 @@ void cSocketThreads::cSocketThread::Execute(void)
RemoveClosedSockets();
} // while (!mShouldTerminate)
-
- LOG("cSocketThread %p is terminating", this);
}