From b117ff54358d4e2b6b8eae4bd5300464f377d948 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 10 Apr 2014 11:17:54 -0700 Subject: Probable fix for GitHub issue #63 - do not unite() if either path is TCP, since doing so can result in asymmetric failed NAT-t over UDP if one side has a firewall that permits outgoing UDP but not incoming. --- node/Socket.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'node/Socket.hpp') diff --git a/node/Socket.hpp b/node/Socket.hpp index 3cfedb1a..e91ce4de 100644 --- a/node/Socket.hpp +++ b/node/Socket.hpp @@ -80,6 +80,15 @@ public: return _type; } + /** + * @return True if this is a UDP socket + */ + inline bool udp() const + throw() + { + return ((_type == ZT_SOCKET_TYPE_UDP_V4)||(_type == ZT_SOCKET_TYPE_UDP_V6)); + } + /** * @return True if this is a TCP socket */ -- cgit v1.2.3