65 lines
1.3 KiB
C++
65 lines
1.3 KiB
C++
//
|
|
// TCP Server
|
|
//
|
|
|
|
/* prevent multiple inclusions */
|
|
#ifndef __UdsServer__
|
|
#define __UdsServer__
|
|
|
|
/* includes *****************************************************************/
|
|
|
|
#include "UdsSocket.h"
|
|
#include "Daemon.h"
|
|
#include "Server.h"
|
|
|
|
/* defines ******************************************************************/
|
|
|
|
/* macros *******************************************************************/
|
|
|
|
/* structs & typedefs *******************************************************/
|
|
|
|
/* c class definitions ******************************************************/
|
|
|
|
class UdsServer : public Server, public UdsSocket {
|
|
// public data
|
|
public:
|
|
|
|
// protected data
|
|
protected:
|
|
|
|
// private data
|
|
private:
|
|
|
|
// static data
|
|
|
|
// public methods
|
|
public:
|
|
// constructors
|
|
UdsServer();
|
|
UdsServer( const char *file );
|
|
|
|
// destructor
|
|
virtual ~UdsServer();
|
|
|
|
// public methods
|
|
int Service( const char *file );
|
|
int Listen( void );
|
|
int Restart( void );
|
|
|
|
// virtual functions
|
|
virtual int ClientSock( int sock ) {return 0;};
|
|
virtual int ClientInOut( char *buf, int n, int max ) {return n;};
|
|
|
|
// exceptions
|
|
class UdsServerException
|
|
{
|
|
char *toString(void) { return strerror(errno); };
|
|
};
|
|
|
|
// static methods
|
|
|
|
private:
|
|
};
|
|
|
|
#endif
|