ScummVM API documentation
Networking::Socket Class Reference

Public Member Functions

 Socket (ENetSocket socket)
 
bool send (const Common::String &address, int port, const char *data)
 
bool receive ()
 
Common::String getData ()
 
Common::String getHost ()
 
int getPort ()
 

Constructor & Destructor Documentation

◆ Socket()

Networking::Socket::Socket ( ENetSocket  socket)

A representation of a raw UDP socket.

Parameters
socketContains the socket itself.

Member Function Documentation

◆ send()

bool Networking::Socket::send ( const Common::String address,
int  port,
const char *  data 
)

Send data to the specified address and port.

Parameters
addressAddress to send data to.
portPort number to send data to.
dataThe data which will be sent.
Return values
trueon successful.
falseon failure.

◆ receive()

bool Networking::Socket::receive ( )

Checks for received data.

Return values
trueif received data.
falseotherwise.

◆ getData()

Common::String Networking::Socket::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()

Common::String Networking::Socket::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: