summaryrefslogtreecommitdiff
path: root/src/network/core/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/core/tcp.h')
-rw-r--r--src/network/core/tcp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h
index 90edba014..7e4964813 100644
--- a/src/network/core/tcp.h
+++ b/src/network/core/tcp.h
@@ -20,8 +20,15 @@ private:
Packet *packet_queue; ///< Packets that are awaiting delivery
Packet *packet_recv; ///< Partially received packet
public:
+ SOCKET sock; ///< The socket currently connected to
bool writable; ///< Can we write to this socket?
+ /**
+ * Whether this socket is currently bound to a socket.
+ * @return true when the socket is bound, false otherwise
+ */
+ bool IsConnected() const { return this->sock != INVALID_SOCKET; }
+
virtual NetworkRecvStatus CloseConnection();
void Send_Packet(Packet *packet);
bool Send_Packets();