Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: TCPServer.h
- Revision:
- 9:1600369a29dd
- Parent:
- 8:9c6673c93082
- Child:
- 17: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