Allolib  1.0
C++ Components For Interactive Multimedia
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
al::CommandConnection Class Referenceabstract
Inheritance diagram for al::CommandConnection:
al::CommandClient al::CommandServer

Public Types

enum  InternalCommands {
  HANDSHAKE = 1 , HANDSHAKE_ACK , GOODBYE , GOODBYE_ACK ,
  PING , PONG , COMMAND_QUIT , COMMAND_LAST_INTERNAL = 32
}
 

Public Member Functions

virtual bool start (uint16_t port, const char *addr)=0
 
virtual void stop ()
 
virtual bool processIncomingMessage (Message &message, Socket *src)
 
virtual bool sendMessage (uint8_t *message, size_t length, Socket *dst=nullptr, ValueSource *src=nullptr)
 sendMessage More...
 
virtual void onReceiveError ()
 
void setVerbose (bool verbose)
 

Protected Types

enum  BarrierState { SERVER , CLIENT , NONE }
 

Protected Member Functions

virtual void onConnection (Socket *newConnection)
 

Protected Attributes

uint16_t mVersion = 0
 
uint16_t mRevision = 0
 
BarrierState mState {BarrierState::NONE}
 
std::mutex mConnectionsLock
 
bool mRunning {false}
 
std::vector< std::unique_ptr< std::thread > > mConnectionThreads
 
std::vector< std::unique_ptr< std::thread > > mDataThreads
 
std::vector< std::shared_ptr< al::Socket > > mServerConnections
 
std::vector< std::pair< uint16_t, uint16_t > > mConnectionVersions
 
al::Socket mSocket
 
bool mVerbose {false}
 

Detailed Description

Definition at line 140 of file al_CommandConnection.hpp.

Member Function Documentation

◆ sendMessage()

virtual bool al::CommandConnection::sendMessage ( uint8_t *  message,
size_t  length,
Socket dst = nullptr,
ValueSource src = nullptr 
)
inlinevirtual

sendMessage

Parameters
message
dst
Returns

if dst is nullptr, the message is sent to all connected sockets If src is not nullptr, the message will not be sent to it

Reimplemented in al::CommandServer, and al::CommandClient.

Definition at line 180 of file al_CommandConnection.hpp.


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