mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Added some safety + unregister callbacks on close
This commit is contained in:
parent
f2cc144811
commit
31ed86740c
2 changed files with 81 additions and 75 deletions
|
@ -56,9 +56,9 @@ struct connect_st;
|
|||
struct getsockname_st;
|
||||
struct accept_st;
|
||||
|
||||
#define APPLICATION_POLL_FREQ 50
|
||||
#define APPLICATION_POLL_FREQ 2
|
||||
#define ZT_LWIP_TCP_TIMER_INTERVAL 5
|
||||
#define STATUS_TMR_INTERVAL 1000 // How often we check connection statuses (in ms)
|
||||
#define STATUS_TMR_INTERVAL 500 // How often we check connection statuses (in ms)
|
||||
#define DEFAULT_BUF_SZ 1024 * 1024 * 2
|
||||
|
||||
namespace ZeroTier {
|
||||
|
@ -71,7 +71,7 @@ class LWIPStack;
|
|||
*/
|
||||
struct TcpConnection
|
||||
{
|
||||
bool listening;
|
||||
bool listening, closing;
|
||||
int pid, txsz, rxsz;
|
||||
PhySocket *rpcSock, *sock;
|
||||
struct tcp_pcb *pcb;
|
||||
|
@ -410,16 +410,6 @@ private:
|
|||
* Returns a pointer to a TcpConnection associated with a given PhySocket
|
||||
*/
|
||||
TcpConnection *getConnection(PhySocket *sock);
|
||||
|
||||
/*
|
||||
* Safely adds a new TcpConnection to _TcpConnections
|
||||
*/
|
||||
TcpConnection *addConnection(TcpConnection *conn);
|
||||
|
||||
/*
|
||||
* Safely removes a TcpConnection from _TcpConnections
|
||||
*/
|
||||
void removeConnection(TcpConnection *conn);
|
||||
|
||||
/*
|
||||
* Closes a TcpConnection, associated LWIP PCB strcuture,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue