mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-31 03:51:02 -07:00
CLI debugging, got rid of nasty old Thread class and replaced with newer cleaner portable idiom.
This commit is contained in:
parent
3368330b77
commit
a7c4cbe53a
17 changed files with 141 additions and 303 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue