Initial commit of files
This commit is contained in:
60
include/libnet++/TcpThread.h
Normal file
60
include/libnet++/TcpThread.h
Normal file
@ -0,0 +1,60 @@
|
||||
//
|
||||
// TCP Thread
|
||||
//
|
||||
|
||||
/* prevent multiple inclusions */
|
||||
#ifndef __TcpThread__
|
||||
#define __TcpThread__
|
||||
|
||||
/* includes *****************************************************************/
|
||||
|
||||
#include "TcpClient.h"
|
||||
#include "Thread.h"
|
||||
|
||||
/* defines ******************************************************************/
|
||||
|
||||
/* macros *******************************************************************/
|
||||
|
||||
/* structs & typedefs *******************************************************/
|
||||
|
||||
/* c class definitions ******************************************************/
|
||||
|
||||
class TcpThread : public TcpClient, public Thread {
|
||||
// public data
|
||||
public:
|
||||
|
||||
// protected data
|
||||
protected:
|
||||
|
||||
// private data
|
||||
private:
|
||||
|
||||
// static data
|
||||
|
||||
// public methods
|
||||
public:
|
||||
// constructors
|
||||
TcpThread();
|
||||
|
||||
// destructor
|
||||
virtual ~TcpThread();
|
||||
|
||||
// public methods
|
||||
void SetSocket( int sock ) {Socket::SetSocket(sock);};
|
||||
int Detach(void) {return pthread_detach(pthread_self());};
|
||||
|
||||
// virtual functions
|
||||
virtual void *Run(void *);
|
||||
|
||||
// exceptions
|
||||
class TcpThreadException
|
||||
{
|
||||
char *toString(void) { return strerror(errno); };
|
||||
};
|
||||
|
||||
// static methods
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user