KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
SocketServerTransport Class Reference

A transport protocol that hosts a client and sends messages to the clients after they connect . More...

#include <AsyncIO.h>

Inheritance diagram for SocketServerTransport:
TransportBase

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
 

Detailed Description

A transport protocol that hosts a client and sends messages to the clients after they connect .


The documentation for this class was generated from the following files: