summaryrefslogtreecommitdiff
path: root/testnet/SimNetSocketManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testnet/SimNetSocketManager.cpp')
-rw-r--r--testnet/SimNetSocketManager.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/testnet/SimNetSocketManager.cpp b/testnet/SimNetSocketManager.cpp
index f6f24184..c75c864f 100644
--- a/testnet/SimNetSocketManager.cpp
+++ b/testnet/SimNetSocketManager.cpp
@@ -26,6 +26,7 @@
*/
#include "SimNetSocketManager.hpp"
+#include "SimNet.hpp"
#include "../node/Constants.hpp"
#include "../node/Socket.hpp"
@@ -73,20 +74,20 @@ bool SimNetSocketManager::send(const InetAddress &to,bool tcp,bool autoConnectTc
void SimNetSocketManager::poll(unsigned long timeout,void (*handler)(const SharedPtr<Socket> &,void *,const InetAddress &,Buffer<ZT_SOCKET_MAX_MESSAGE_LEN> &),void *arg)
{
{
- Mutex::Lock _l(_lock);
- while (!_queue.empty()) {
- handler(_mySocket,arg,_queue.front().first,_queue.front().second);
- _queue.pop();
+ Mutex::Lock _l(_inbox_m);
+ while (!_inbox.empty()) {
+ handler(_mySocket,arg,_inbox.front().first,_inbox.front().second);
+ _inbox.pop();
}
}
if (timeout)
_waitCond.wait(timeout);
else _waitCond.wait();
{
- Mutex::Lock _l(_lock);
- while (!_queue.empty()) {
- handler(_mySocket,arg,_queue.front().first,_queue.front().second);
- _queue.pop();
+ Mutex::Lock _l(_inbox_m);
+ while (!_inbox.empty()) {
+ handler(_mySocket,arg,_inbox.front().first,_inbox.front().second);
+ _inbox.pop();
}
}
}