Initial commit of files
This commit is contained in:
74
include/libnet++/UdpSocket.h
Normal file
74
include/libnet++/UdpSocket.h
Normal file
@ -0,0 +1,74 @@
|
||||
//
|
||||
// Socket
|
||||
//
|
||||
|
||||
/* prevent multiple inclusions */
|
||||
#ifndef __UdpSocket__
|
||||
#define __UdpSocket__
|
||||
|
||||
/* includes *****************************************************************/
|
||||
|
||||
#include "Socket.h"
|
||||
|
||||
/* defines ******************************************************************/
|
||||
|
||||
/* macros *******************************************************************/
|
||||
|
||||
/* structs & typedefs *******************************************************/
|
||||
|
||||
/* c class definitions ******************************************************/
|
||||
|
||||
class UdpSocket : public Socket {
|
||||
// public data
|
||||
public:
|
||||
|
||||
// protected data
|
||||
protected:
|
||||
struct sockaddr_storage sock_addr;
|
||||
socklen_t sock_len;
|
||||
|
||||
// private data
|
||||
private:
|
||||
|
||||
// static data
|
||||
|
||||
// public methods
|
||||
public:
|
||||
// constructors
|
||||
UdpSocket();
|
||||
|
||||
// destructor
|
||||
virtual ~UdpSocket();
|
||||
|
||||
// copy constructor
|
||||
UdpSocket( const UdpSocket &src ) ;
|
||||
const UdpSocket& operator=( const UdpSocket &src );
|
||||
|
||||
// public methods
|
||||
int Socket( const char *host, const char *port );
|
||||
int Client( const char *host, const char *port );
|
||||
int Server( const char *host, const char *port );
|
||||
int Broadcast( const char *host, const char *port,
|
||||
struct sockaddr_storage *sa, socklen_t *len );
|
||||
int Listener( const char *host, const char *port );
|
||||
int Multicast( const char *host, const char *port,
|
||||
struct sockaddr_storage *sa, socklen_t *len );
|
||||
|
||||
int RecvFrom( void *buf, int max );
|
||||
int SendTo( const void *buf, int len );
|
||||
|
||||
// control
|
||||
|
||||
// status
|
||||
|
||||
// virtual functions
|
||||
|
||||
// exceptions
|
||||
|
||||
// static methods
|
||||
|
||||
// private methods
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user