Embed: (wiki syntax)

« Back to documentation index

UDPSocket Class Reference

UDPSocket Class Reference

This is a simple UDP Socket class. More...

#include <UDPSocket.h>

Public Member Functions

 UDPSocket ()
 Creates a new socket.
 ~UDPSocket ()
 Closes and destroys socket.
UDPSocketErr bind (const Host &me)
 Binds the socket to local host or a multicast address.
int sendto (const char *buf, int len, Host *pHost)
 Sends data.
int recvfrom (char *buf, int len, Host *pHost)
 Receives data.
UDPSocketErr close ()
 Closes socket.
void setOnEvent (void(*pMethod)(UDPSocketEvent))
 Setups callback.
template<class T >
void setOnEvent (T *pItem, void(T::*pMethod)(UDPSocketEvent))
 Setups callback.
void resetOnEvent ()
 Disables callback.
 UDPSocket ()
 Creates a new socket.
 ~UDPSocket ()
 Closes and destroys socket.
UDPSocketErr bind (const Host &me)
 Binds the socket to local host or a multicast address.
int sendto (const char *buf, int len, Host *pHost)
 Sends data.
int recvfrom (char *buf, int len, Host *pHost)
 Receives data.
UDPSocketErr close ()
 Closes socket.
void setOnEvent (void(*pMethod)(UDPSocketEvent))
 Setups callback.
template<class T >
void setOnEvent (T *pItem, void(T::*pMethod)(UDPSocketEvent))
 Setups callback.
void resetOnEvent ()
 Disables callback.

Detailed Description

This is a simple UDP Socket class.

This class exposes an API to deal with UDP Sockets

Definition at line 60 of file LPC1768/api/UDPSocket.h.


Constructor & Destructor Documentation

UDPSocket (  )

Creates a new socket.

~UDPSocket (  )

Closes and destroys socket.

UDPSocket (  )

Creates a new socket.

~UDPSocket (  )

Closes and destroys socket.


Member Function Documentation

UDPSocketErr bind ( const Host me )

Binds the socket to local host or a multicast address.

UDPSocketErr bind ( const Host me )

Binds the socket to local host or a multicast address.

UDPSocketErr close (  )

Closes socket.

UDPSocketErr close (  )

Closes socket.

int recvfrom ( char *  buf,
int  len,
Host pHost 
)

Receives data.

int recvfrom ( char *  buf,
int  len,
Host pHost 
)

Receives data.

void resetOnEvent (  )

Disables callback.

void resetOnEvent (  )

Disables callback.

int sendto ( const char *  buf,
int  len,
Host pHost 
)

Sends data.

int sendto ( const char *  buf,
int  len,
Host pHost 
)

Sends data.

void setOnEvent ( void(*)(UDPSocketEvent pMethod )

Setups callback.

Parameters:
pMethod: callback function
void setOnEvent ( T *  pItem,
void(T::*)(UDPSocketEvent pMethod 
)

Setups callback.

Parameters:
pItem: instance of class on which to execute the callback method
pMethod: callback method

Definition at line 105 of file LPC2368/api/UDPSocket.h.

void setOnEvent ( void(*)(UDPSocketEvent pMethod )

Setups callback.

Parameters:
pMethod: callback function
void setOnEvent ( T *  pItem,
void(T::*)(UDPSocketEvent pMethod 
)

Setups callback.

Parameters:
pItem: instance of class on which to execute the callback method
pMethod: callback method

Definition at line 105 of file LPC1768/api/UDPSocket.h.