summaryrefslogtreecommitdiff
path: root/node/SocketManager.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-20 20:07:35 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-20 20:07:35 -0700
commitba3f04deedb3a09e8683b2507b7c2176e87e3766 (patch)
tree5acc2fbbabdd68f7327586cf773b243921846557 /node/SocketManager.cpp
parent45e823d27ca83bf893e69c692ef9a842c97e5ffe (diff)
downloadinfinitytier-ba3f04deedb3a09e8683b2507b7c2176e87e3766.tar.gz
infinitytier-ba3f04deedb3a09e8683b2507b7c2176e87e3766.zip
Work in progress: refactoring paths, adding TCP fallback.
Diffstat (limited to 'node/SocketManager.cpp')
-rw-r--r--node/SocketManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/node/SocketManager.cpp b/node/SocketManager.cpp
index 7af4b29d..a977a546 100644
--- a/node/SocketManager.cpp
+++ b/node/SocketManager.cpp
@@ -577,4 +577,19 @@ void SocketManager::whack()
_whackSendPipe_m.unlock();
}
+void closeTcpSockets()
+{
+ {
+ Mutex::Lock _l2(_tcpSockets_m);
+ _fdSetLock.lock();
+ for(std::map< InetAddress,SharedPtr<Socket> >::iterator s(_tcpSockets.begin());s!=_tcpSockets.end();++s`) {
+ FD_CLR((*s)->_sock,&_readfds);
+ FD_CLR((*s)->_sock,&_writefds);
+ }
+ _fdSetLock.unlock();
+ _tcpSockets.clear();
+ }
+ _updateNfds();
+}
+
} // namespace ZeroTier