diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-05 16:06:16 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-05 16:06:16 -0400 |
| commit | a7c4cbe53aad51b3e74fa9cb1af975cb8d356954 (patch) | |
| tree | e4578c51ea7239aeaf5dd6ebcaa844a0fb00f9ea /node/UdpSocket.hpp | |
| parent | 3368330b777da9561539c04ea589aa7060e1d569 (diff) | |
| download | infinitytier-a7c4cbe53aad51b3e74fa9cb1af975cb8d356954.tar.gz infinitytier-a7c4cbe53aad51b3e74fa9cb1af975cb8d356954.zip | |
CLI debugging, got rid of nasty old Thread class and replaced with newer cleaner portable idiom.
Diffstat (limited to 'node/UdpSocket.hpp')
| -rw-r--r-- | node/UdpSocket.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/node/UdpSocket.hpp b/node/UdpSocket.hpp index a3223f1f..3f624387 100644 --- a/node/UdpSocket.hpp +++ b/node/UdpSocket.hpp @@ -40,7 +40,7 @@ namespace ZeroTier { * * The socket listens in a background thread and sends packets to Switch. */ -class UdpSocket : protected Thread +class UdpSocket { public: /** @@ -61,7 +61,7 @@ public: void *arg) throw(std::runtime_error); - virtual ~UdpSocket(); + ~UdpSocket(); /** * @return Locally bound port @@ -87,11 +87,14 @@ public: bool send(const InetAddress &to,const void *data,unsigned int len,int hopLimit) throw(); -protected: - virtual void main() + /** + * Thread main method; do not call elsewhere + */ + void threadMain() throw(); private: + Thread<UdpSocket> _thread; void (*_packetHandler)(UdpSocket *,void *,const InetAddress &,const void *,unsigned int); void *_arg; int _localPort; |
