summaryrefslogtreecommitdiff
path: root/node/Socket.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-31 22:23:55 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-31 22:23:55 -0700
commitf13493edb2aae228ddbe70cc2f0609c541faf2d7 (patch)
treecb1a6845ec82e2ea361ce15e88440a249992091c /node/Socket.hpp
parent595b386afcd4e4eca0cf379cd14689c1db8ee647 (diff)
downloadinfinitytier-f13493edb2aae228ddbe70cc2f0609c541faf2d7.tar.gz
infinitytier-f13493edb2aae228ddbe70cc2f0609c541faf2d7.zip
Oops... turns out we need to differentiate incoming from outgoing TCP and indeed learn incoming TCP paths. Otherwise the recipient of a TCP connection does not know to reply via TCP! Heh.
Diffstat (limited to 'node/Socket.hpp')
-rw-r--r--node/Socket.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/node/Socket.hpp b/node/Socket.hpp
index ff185e6f..3cfedb1a 100644
--- a/node/Socket.hpp
+++ b/node/Socket.hpp
@@ -65,7 +65,8 @@ public:
{
ZT_SOCKET_TYPE_UDP_V4,
ZT_SOCKET_TYPE_UDP_V6,
- ZT_SOCKET_TYPE_TCP
+ ZT_SOCKET_TYPE_TCP_IN, // incoming connection, not listen
+ ZT_SOCKET_TYPE_TCP_OUT
};
virtual ~Socket() {}
@@ -80,6 +81,15 @@ public:
}
/**
+ * @return True if this is a TCP socket
+ */
+ inline bool tcp() const
+ throw()
+ {
+ return ((_type == ZT_SOCKET_TYPE_TCP_IN)||(_type == ZT_SOCKET_TYPE_TCP_OUT));
+ }
+
+ /**
* Send a ZeroTier message packet
*
* @param to Destination address (ignored in connected TCP sockets)