66 lines
1.4 KiB
C++
66 lines
1.4 KiB
C++
//
|
|
// UDP Caster
|
|
//
|
|
|
|
/* prevent multiple inclusions */
|
|
#ifndef __UdpCaster__
|
|
#define __UdpCaster__
|
|
|
|
/* includes *****************************************************************/
|
|
|
|
#include "UdpSocket.h"
|
|
|
|
/* defines ******************************************************************/
|
|
|
|
/* macros *******************************************************************/
|
|
|
|
/* structs & typedefs *******************************************************/
|
|
|
|
/* c class definitions ******************************************************/
|
|
|
|
class UdpCaster : public UdpSocket {
|
|
// public data
|
|
public:
|
|
|
|
protected:
|
|
|
|
// private data
|
|
private:
|
|
|
|
// static data
|
|
|
|
// public methods
|
|
public:
|
|
// constructors
|
|
UdpCaster();
|
|
UdpCaster( const char *host, const char *service );
|
|
|
|
// destructor
|
|
virtual ~UdpCaster();
|
|
|
|
// public methods
|
|
int BroadcasterUri( const char *uri );
|
|
int Broadcaster( const char *host, const char *service=NULL );
|
|
int CasterUri( const char *uri );
|
|
int Caster( const char *host, const char *service=NULL );
|
|
int Restart( void );
|
|
|
|
// virtual functions
|
|
virtual int SendTo( const void *buf, int max );
|
|
|
|
// exceptions
|
|
class UdpCasterException
|
|
{
|
|
char *toString(void) { return strerror(errno); };
|
|
};
|
|
|
|
// static methods
|
|
|
|
// private methods
|
|
void Init( void );
|
|
|
|
private:
|
|
};
|
|
|
|
#endif
|