mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 01:11:54 +00:00
Finally fixed TCP sockets.
This commit is contained in:
parent
c231510f8b
commit
d2c5d71502
@ -395,8 +395,13 @@ bool SocketManager::send(const InetAddress &to,bool tcp,const void *msg,unsigned
|
|||||||
}
|
}
|
||||||
|
|
||||||
ts = SharedPtr<Socket>(new TcpSocket(this,s,connecting,to));
|
ts = SharedPtr<Socket>(new TcpSocket(this,s,connecting,to));
|
||||||
if (!ts->send(to,msg,msglen))
|
if (!ts->send(to,msg,msglen)) {
|
||||||
|
_fdSetLock.lock();
|
||||||
|
FD_CLR(s,&_readfds);
|
||||||
|
FD_CLR(s,&_writefds);
|
||||||
|
_fdSetLock.unlock();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_tcpSockets_m);
|
Mutex::Lock _l(_tcpSockets_m);
|
||||||
@ -408,6 +413,8 @@ bool SocketManager::send(const InetAddress &to,bool tcp,const void *msg,unsigned
|
|||||||
if (connecting)
|
if (connecting)
|
||||||
FD_SET(s,&_writefds);
|
FD_SET(s,&_writefds);
|
||||||
_fdSetLock.unlock();
|
_fdSetLock.unlock();
|
||||||
|
|
||||||
|
_updateNfds();
|
||||||
whack();
|
whack();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user