NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Diff: TCPServer.h
- Revision:
- 81:1600369a29dd
- Parent:
- 80:9c6673c93082
- Child:
- 89:b1d417383c0d
--- a/TCPServer.h Tue Apr 05 12:02:56 2016 -0500 +++ b/TCPServer.h Tue Apr 05 12:52:07 2016 -0500 @@ -28,6 +28,7 @@ /** TCP Server lifetime */ TCPServer(NetworkInterface *iface); + virtual ~TCPServer(); /** Bind a socket to a specific port \param port The port to listen for incoming connections on @@ -53,6 +54,14 @@ interrupt context. */ void attach_accept(mbed::FuncPtr<void()> callback); + + template <typename T, typename M> + void attach_accept(T *tptr, M mptr) { + attach_accept(mbed::FuncPtr<void()>(tptr, mptr)); + } + +private: + mbed::FuncPtr<void()> _accept_cb; }; #endif