improved testing and connection handling

This commit is contained in:
Joseph Henry
2017-04-20 13:39:46 -07:00
parent c65b609fb4
commit 76abb3e0a2
30 changed files with 2430 additions and 775 deletions

View File

@@ -56,6 +56,7 @@ namespace ZeroTier {
std::queue<Connection*> _AcceptedConnections;
SocketTap *tap; // Reference to SocketTap
int state; // See ZeroTierSDK.h for (ZT_SOCK_STATE_*)
Connection() {
ZT_PHY_SOCKFD_TYPE fdpair[2];
@@ -69,5 +70,15 @@ namespace ZeroTier {
app_fd = fdpair[1];
}
};
/*
* A helper object for passing SocketTaps and Connections through the stack
*/
struct ConnectionPair
{
SocketTap *tap;
Connection *conn;
ConnectionPair(SocketTap *_tap, Connection *conn) : tap(_tap), conn(conn) {}
};
}
#endif