diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-02-05 21:24:46 +0100 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-02-05 21:24:46 +0100 |
commit | 85fe75d1cbaf372f0a98558adcd5a612a0e19602 (patch) | |
tree | 8a552ca0e7bb69b192568037bb2857501abe0674 /src/connection.h | |
parent | 7f743178db2a45bd3f68ef2c9c7df6deca1f3ab6 (diff) | |
download | minetest-85fe75d1cbaf372f0a98558adcd5a612a0e19602.tar.gz minetest-85fe75d1cbaf372f0a98558adcd5a612a0e19602.tar.bz2 minetest-85fe75d1cbaf372f0a98558adcd5a612a0e19602.zip |
Add the option to bind to a specific address
Diffstat (limited to 'src/connection.h')
-rw-r--r-- | src/connection.h | 9 |
1 files changed, 4 insertions, 5 deletions
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(); |