Linux: Binds to MY_IP_ADDRESS in client mode (#849)

This commit is contained in:
Marcelo Aquino
2017-05-21 14:27:22 +02:00
committed by Olivier
parent abba1ec377
commit fb3d936d4c
5 changed files with 45 additions and 10 deletions
+6 -1
View File
@@ -155,6 +155,10 @@ public:
* @brief Close the connection.
*/
void close();
/**
* @brief Bind the conection to the specified local ip.
*/
void bind(IPAddress ip);
/**
* @brief Get the internal socket file descriptor.
*
@@ -200,7 +204,8 @@ public:
friend class EthernetServer;
private:
int _sock; //!< @brief Network socket.
int _sock; //!< @brief Network socket file descriptor.
IPAddress _srcip; //!< @brief Local ip to bind to.
};
#endif