Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
Generated on Tue Jul 12 2022 16:33:56 by
1.7.2