◆ Socket()
Networking::Socket::Socket |
( |
ENetSocket |
socket | ) |
|
A representation of a raw UDP socket.
- Parameters
-
socket | Contains the socket itself. |
◆ send()
bool Networking::Socket::send |
( |
const Common::String & |
address, |
|
|
int |
port, |
|
|
const char * |
data |
|
) |
| |
Send data to the specified address and port.
- Parameters
-
address | Address to send data to. |
port | Port number to send data to. |
data | The data which will be sent. |
- Return values
-
true | on successful. |
false | on failure. |
◆ receive()
bool Networking::Socket::receive |
( |
| ) |
|
Checks for received data.
- Return values
-
true | if received data. |
false | otherwise. |
◆ getData()
Get the data received from socket.
- Returns
- String containing received data.
- Note
- receive() must be called and returned true to get actual data.
◆ getHost()
Get the host name of received data.
- Returns
- The host name
- Note
- receive() must be called and returned true to get host name.
◆ getPort()
int Networking::Socket::getPort |
( |
| ) |
|
Get the port number of received data.
- Returns
- The port number
- Note
- receive() must be called and returned true to get port.
The documentation for this class was generated from the following file: