#include <Network.h>
List of all members.
Detailed Description
This class is a UDP Network wrapper for low level C functions.
Constructor & Destructor Documentation
This constructor will setup the Network API for windows
- Author:
- Pierre-Marie Plans
Member Function Documentation
Bind a destination address to a socket
- Author:
- Pierre-Marie Plans
- Parameters:
-
| in | (int) socket file descriptor |
| inout | (struct sockaddr_in) address |
- Returns:
- 1 if success, 0 else
Closes the socket.
- Author:
- Pierre-Marie Plans
- Parameters:
-
| in | (int) socket file descriptor |
Init a sockaddress with the values provided.
- Author:
- Pierre-Marie Plans
- Parameters:
-
| inout | (struct sockaddr_in) address |
| in | (const char *) address to bind, NULL is considered as Broadcast address |
| in | (int) port |
- Returns:
- 1 if success, 0 else
Make a DGRAM socket and returns the socket file descriptor
- Author:
- Pierre-Marie Plans
- Returns:
- socket file descriptor (int)
Will print network API errors on STDERR standard output.
- Author:
- Pierre-Marie Plans
| int Network::recvUDPFrom |
( |
struct sockaddr_in * |
sockaddr, |
|
|
int |
sockfd, |
|
|
std::string & |
msgout, |
|
|
bool |
dontwait = false |
|
) |
| |
Receive an UDP packet from a given address. For the moment it reads only 1024 bytes.
- Author:
- Pierre-Marie Plans
- Parameters:
-
| in | (struct sockaddr_in) address |
| in | (int) socket file descriptor |
| out | (std::string) packet received |
- Returns:
- number of bytes read, 0 or less means an error occured.
Send a UDP packet to a specific address.
- Author:
- Pierre-Marie Plans
- Parameters:
-
| in | (struct sockaddr_in) address |
| in | (int) socket file descriptor |
| in | (const char *) packet to send, finishing by '\0' char |
- Returns:
- 1 if success, 0 else
The documentation for this class was generated from the following files:
- sources/TobiiSDK/TobiiGlasses2SDK/src/Network.h
- sources/TobiiSDK/TobiiGlasses2SDK/src/Network.cpp