NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Diff: TCPServer.cpp
- Revision:
- 96:656011e49d9f
- Parent:
- 93:65a9f84862f0
- Child:
- 98:0f614f1d0398
--- a/TCPServer.cpp Tue Apr 19 18:24:24 2016 -0500 +++ b/TCPServer.cpp Tue Apr 19 18:24:34 2016 -0500 @@ -33,11 +33,23 @@ int TCPServer::bind(uint16_t port) { + SocketAddress addr(0, port); + return bind(addr); +} + +int TCPServer::bind(const char *address, uint16_t port) +{ + SocketAddress addr(address, port); + return bind(addr); +} + +int TCPServer::bind(const SocketAddress &address) +{ if (!_socket) { - return NSAPI_ERROR_NO_SOCKET; + return NSAPI_ERROR_NO_SOCKET; } - return _iface->socket_bind(_socket, port); + return _iface->socket_bind(_socket, address); } int TCPServer::listen(int backlog)