SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ai::Network Class Reference
Collaboration diagram for ai::Network:
[legend]

Public Member Functions

 Network (uint16_t port=10001, const std::string &hostname="0.0.0.0")
 
bool start ()
 
void update (int64_t deltaTime)
 
void addListener (INetworkListener *listener)
 
void removeListener (INetworkListener *listener)
 
int getConnectedClients () const
 
bool broadcast (const IProtocolMessage &msg)
 
bool sendToClient (Client *client, const IProtocolMessage &msg)
 

Protected Types

typedef std::list< ClientClientSockets
 
typedef ClientSockets::iterator ClientSocketsIter
 
typedef std::list
< INetworkListener * > 
Listeners
 

Protected Member Functions

ClientSocketsIter closeClient (ClientSocketsIter &i)
 
bool sendMessage (Client &client)
 

Protected Attributes

uint16_t _port
 
std::string _hostname
 
SOCKET _socketFD
 
fd_set _readFDSet
 
fd_set _writeFDSet
 
int64_t _time
 
ClientSockets _clientSockets
 
Listeners _listeners
 

Member Function Documentation

bool ai::Network::broadcast ( const IProtocolMessage msg)
inline
Returns
false if there are no clients

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