From 85fe75d1cbaf372f0a98558adcd5a612a0e19602 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Wed, 5 Feb 2014 21:24:46 +0100 Subject: Add the option to bind to a specific address --- src/connection.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/connection.h') diff --git a/src/connection.h b/src/connection.h index c9474032d..9d646f499 100644 --- a/src/connection.h +++ b/src/connection.h @@ -406,7 +406,6 @@ enum ConnectionCommandType{ struct ConnectionCommand { enum ConnectionCommandType type; - u16 port; Address address; u16 peer_id; u8 channelnum; @@ -416,10 +415,10 @@ struct ConnectionCommand ConnectionCommand(): type(CONNCMD_NONE), peer_id(PEER_ID_INEXISTENT), reliable(false), raw(false) {} - void serve(u16 port_) + void serve(Address address_) { type = CONNCMD_SERVE; - port = port_; + address = address_; } void connect(Address address_) { @@ -912,7 +911,7 @@ private: void processReliableCommand (ConnectionCommand &c); void processNonReliableCommand (ConnectionCommand &c); - void serve (u16 port); + void serve (Address bind_address); void connect (Address address); void disconnect (); void disconnect_peer(u16 peer_id); @@ -996,7 +995,7 @@ public: void putCommand(ConnectionCommand &c); void SetTimeoutMs(int timeout){ m_bc_receive_timeout = timeout; } - void Serve(unsigned short port); + void Serve(Address bind_addr); void Connect(Address address); bool Connected(); void Disconnect(); -- cgit v1.2.3