Donatien Garnier / EthernetNetIfBeta
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.
UDPSocketErr bind (const Host &me)
 Binds the socket to (local) host (or TODO: 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.
void resetOnEvent ()
 Disables callback.
 UDPSocket ()
 Creates a new socket.
UDPSocketErr bind (const Host &me)
 Binds the socket to (local) host (or TODO: 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.
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 52 of file LPC1768/api/UDPSocket.h.


Constructor & Destructor Documentation

UDPSocket (  )

Creates a new socket.

UDPSocket (  )

Creates a new socket.


Member Function Documentation

UDPSocketErr bind ( const Host &  me )

Binds the socket to (local) host (or TODO: a multicast address)

UDPSocketErr bind ( const Host &  me )

Binds the socket to (local) host (or TODO: 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 ( void(*)(UDPSocketEvent)  pMethod )

Setups callback.

Parameters:
pMethod: callback function