KrisLibrary
1.0.0
|
A transport protocol that hosts a client and sends messages to the clients after they connect . More...
#include <AsyncIO.h>
Public Member Functions | |
SocketServerTransport (const char *addr, int maxclients=1) | |
virtual bool | Start () |
Subclasses – can the object read? | |
virtual bool | Stop () |
virtual bool | ReadReady () |
Subclasses – can the object read? | |
virtual bool | WriteReady () |
Subclasses – can the object write? | |
virtual const std::string * | DoRead () |
Reads a string (4 byte length + data) from all clients. Note: blocking. | |
virtual bool | DoWrite (const char *str, int length) |
Writes a string (4 byte length + data) to all clients. Note: blocking. | |
Public Member Functions inherited from TransportBase | |
virtual bool | DoWrite (const char *msg) |
virtual bool | DoWrite (const std::string &msg) |
Public Attributes | |
std::string | addr |
int | serversocket |
int | maxclients |
Mutex | mutex |
std::vector< std::unique_ptr< File > > | clientsockets |
int | currentclient |
std::string | buf |
A transport protocol that hosts a client and sends messages to the clients after they connect .