- bugs fixed
This commit is contained in:
parent
9d31979db3
commit
f94960ebbb
|
|
@ -222,6 +222,8 @@ void SocketHeap::thread()
|
||||||
/*#ifdef __linux__
|
/*#ifdef __linux__
|
||||||
// TODO: make epoll implementation for massive polling
|
// TODO: make epoll implementation for massive polling
|
||||||
#else*/
|
#else*/
|
||||||
|
mId = ThreadIf::selfId();
|
||||||
|
|
||||||
while (!isShutdown())
|
while (!isShutdown())
|
||||||
{
|
{
|
||||||
// Define socket agreggator
|
// Define socket agreggator
|
||||||
|
|
@ -237,11 +239,14 @@ void SocketHeap::thread()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update socket set
|
// Update socket set
|
||||||
for (SocketMap::iterator socketIter = mSocketMap.begin(); socketIter != mSocketMap.end(); ++socketIter)
|
for (auto& socketIter: mSocketMap)
|
||||||
|
agreggator.addSocket(socketIter.second.mSocket);
|
||||||
|
|
||||||
|
/* for (SocketMap::iterator socketIter = mSocketMap.begin(); socketIter != mSocketMap.end(); ++socketIter)
|
||||||
{
|
{
|
||||||
// Add handle to set
|
// Add handle to set
|
||||||
agreggator.addSocket(socketIter->second.mSocket);
|
agreggator.addSocket(socketIter->second.mSocket);
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
// If set is not empty
|
// If set is not empty
|
||||||
|
|
@ -281,7 +286,7 @@ void SocketHeap::thread()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SyncHelper::delay(1000); // Delay for 1 millisecond
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
}
|
}
|
||||||
mId = 0;
|
mId = 0;
|
||||||
mShutdown = false;
|
mShutdown = false;
|
||||||
|
|
|
||||||
|
|
@ -103,10 +103,9 @@ protected:
|
||||||
Mutex mDeleteGuard;
|
Mutex mDeleteGuard;
|
||||||
|
|
||||||
char mTempPacket[MAX_UDPPACKET_SIZE];
|
char mTempPacket[MAX_UDPPACKET_SIZE];
|
||||||
volatile bool mShutdown = false;
|
|
||||||
|
|
||||||
int mId = 0;
|
int mId = 0;
|
||||||
bool isShutdown() const { return mShutdown; }
|
//bool isShutdown() const { return mShutdown; }
|
||||||
virtual void thread();
|
virtual void thread();
|
||||||
|
|
||||||
// Processes mDeleteVector -> updates mSocketMap, removes socket items and closes sockets specified in mDeleteVector
|
// Processes mDeleteVector -> updates mSocketMap, removes socket items and closes sockets specified in mDeleteVector
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue