#include <SocketUDP.hpp>
Public Member Functions | |
sfSocketUDP () | |
Default constructor. | |
bool | Send (const char *Data, std::size_t Size, const sfIPAddress &Address, unsigned short Port) |
Send an array of bytes. | |
bool | Receive (char *Data, std::size_t MaxSize, std::size_t &SizeReceived, sfIPAddress &Address, unsigned short Port) |
Receive an array of bytes. | |
bool | Send (sfPacket &Packet, const sfIPAddress &Address, unsigned short Port) |
Send a packet of data. | |
bool | Receive (sfPacket &Packet, sfIPAddress &Address, unsigned short Port) |
Receive a packet. | |
bool | Close () |
Close the socket. | |
bool | operator== (const sfSocketUDP &Other) const |
Comparison operator ==. | |
bool | operator!= (const sfSocketUDP &Other) const |
Comparison operator !=. | |
bool | operator< (const sfSocketUDP &Other) const |
Comparison operator <. | |
Friends | |
class | sfSelector< sfSocketUDP > |
Definition at line 43 of file SocketUDP.hpp.
sfSocketUDP::sfSocketUDP | ( | ) |
bool sfSocketUDP::Send | ( | const char * | Data, | |
std::size_t | Size, | |||
const sfIPAddress & | Address, | |||
unsigned short | Port | |||
) |
Send an array of bytes.
Data | : Pointer to the bytes to send | |
Size | : Number of bytes to send | |
Address | : Address of the computer to send the packet to | |
Port | : Port to use for communication |
Definition at line 48 of file SocketUDP.cpp.
bool sfSocketUDP::Receive | ( | char * | Data, | |
std::size_t | MaxSize, | |||
std::size_t & | SizeReceived, | |||
sfIPAddress & | Address, | |||
unsigned short | Port | |||
) |
Receive an array of bytes.
This function is blocking, ie. it won't return before some bytes have been received
Data | : Pointer to a byte array to fill (make sure it is big enough) | |
MaxSize | : Maximum number of bytes to read | |
SizeReceived | : Number of bytes received | |
Address | : Address of the computer to send the packet to | |
Port | : Port to use for communication |
Definition at line 93 of file SocketUDP.cpp.
bool sfSocketUDP::Send | ( | sfPacket & | Packet, | |
const sfIPAddress & | Address, | |||
unsigned short | Port | |||
) |
Send a packet of data.
Packet | : Packet to send | |
Address | : Address of the computer to send the packet to | |
Port | : Port to use for communication |
Definition at line 174 of file SocketUDP.cpp.
bool sfSocketUDP::Receive | ( | sfPacket & | Packet, | |
sfIPAddress & | Address, | |||
unsigned short | Port | |||
) |
Receive a packet.
This function is blocking, ie. it won't return before a packet is received
Packet | : Packet to fill with received data | |
Address | : Address of the computer that sent the packet | |
Port | : Port to use for communication |
Definition at line 197 of file SocketUDP.cpp.
bool sfSocketUDP::Close | ( | ) |
Close the socket.
Definition at line 239 of file SocketUDP.cpp.
bool sfSocketUDP::operator== | ( | const sfSocketUDP & | Other | ) | const |
Comparison operator ==.
Other | : Socket to compare |
Definition at line 254 of file SocketUDP.cpp.
bool sfSocketUDP::operator!= | ( | const sfSocketUDP & | Other | ) | const |
Comparison operator !=.
Other | : Socket to compare |
Definition at line 263 of file SocketUDP.cpp.
bool sfSocketUDP::operator< | ( | const sfSocketUDP & | Other | ) | const |
Comparison operator <.
Provided for compatibility with standard containers, as comparing two sockets doesn't make much sense...
Other | : Socket to compare |
Definition at line 274 of file SocketUDP.cpp.