#include <Server.hpp>
Inheritance diagram for sfServer:
Public Member Functions | |
virtual | ~sfServer () |
Virtual destructor. | |
void | Start (unsigned short Port, std::size_t MaxClients=std::numeric_limits< std::size_t >::max()) |
Start the server. | |
void | Stop () |
Stop the server (disconnects every client). | |
void | SendTo (sfSocketTCP Client, sfPacket &Packet) |
Send a packet to a specific client. | |
void | SendToAll (sfPacket &Packet, sfSocketTCP *Exclude=NULL) |
Send a packet to all clients (option is given to exclude one specific client). | |
void | Disconnect (sfSocketTCP Client) |
Disconnect a client. |
Definition at line 44 of file Server.hpp.
sfServer::~sfServer | ( | ) | [virtual] |
void sfServer::Start | ( | unsigned short | Port, | |
std::size_t | MaxClients = std::numeric_limits< std::size_t >::max() | |||
) |
Start the server.
Port | : Port to use for listening to the incoming connections | |
MaxClients | : Maximum number of clients allowed at the same time (no limit by default) |
Definition at line 47 of file Server.cpp.
void sfServer::Stop | ( | ) |
void sfServer::SendTo | ( | sfSocketTCP | Client, | |
sfPacket & | Packet | |||
) |
Send a packet to a specific client.
Client | : Socket (client) to use for sending the packet | |
Packet | : Packet to send |
Definition at line 79 of file Server.cpp.
void sfServer::SendToAll | ( | sfPacket & | Packet, | |
sfSocketTCP * | Exclude = NULL | |||
) |
Send a packet to all clients (option is given to exclude one specific client).
Packet | : Packet to send | |
Exclude | : Pointer to a client to exclude (NULL by default) |
Definition at line 90 of file Server.cpp.
void sfServer::Disconnect | ( | sfSocketTCP | Client | ) |
Disconnect a client.
Client | : Socket to disconnect |
Definition at line 109 of file Server.cpp.