diff options
Diffstat (limited to 'node/SocketManager.cpp')
-rw-r--r-- | node/SocketManager.cpp | 15 |
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 |