summaryrefslogtreecommitdiffstats
path: root/source/cSocketThreads.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);
}