#include <TCPMessageClient.hpp>
Inheritance diagram for Ionflux::Tools::TCPMessageClient:
Public Member Functions | |
TCPMessageClient () | |
Constructor. | |
TCPMessageClient (bool initInteractive) | |
Constructor. | |
virtual | ~TCPMessageClient () |
Destructor. | |
virtual void | onInput (const std::string &line) |
Event handler for standard input. | |
virtual void | onMessage (TCPRemotePeer &peer) |
Event handler for received messages. | |
virtual void | onInvalidMessage (TCPRemotePeer &peer) |
Event handler for invalid messages. | |
virtual void | broadcast (const std::string &bytes) |
Broadcast bytes. | |
Protected Member Functions | |
virtual void | onConnect (TCPRemotePeer &peer) |
Event handler for new connections. | |
virtual void | onReceive (TCPRemotePeer &peer) |
Event handler for received data. |
A Message based TCP client. This works like a TCPClient, except that incoming data is unpacked into a message (if possible). Outgoing data is wrapped into a message and serialized before being sent over the socket.
|
Constructor. Construct new TCPMessageClient object. |
|
Constructor. Construct new TCPMessageClient object.
|
|
Destructor. Destruct TCPMessageClient object. |
|
Broadcast bytes. Sends the specified byte string to all connected peers.
Reimplemented from Ionflux::Tools::TCPClient. Reimplemented in Ionflux::Tools::TCPAuthClient. |
|
Event handler for new connections. This is called by the main loop whenever a connection to a peer is successfully established.
Reimplemented from Ionflux::Tools::TCPClient. Reimplemented in Ionflux::Tools::TCPAuthClient. |
|
Event handler for standard input. For interactive clients, this is called by the main loop whenever data is available on standard input.
Reimplemented from Ionflux::Tools::TCPClient. |
|
Event handler for invalid messages. This is called whenever an invalid message is received from a peer.
Implements Ionflux::Tools::MessageHandler. Reimplemented in Ionflux::Tools::TCPAuthClient. |
|
Event handler for received messages. This is called whenever a valid message is received from a peer. The received message will be available from TCPRemotePeer::getMessage().
Implements Ionflux::Tools::MessageHandler. Reimplemented in Ionflux::Tools::TCPAuthClient. |
|
Event handler for received data. This is called by the main loop whenever data is received from a peer. The received bytes will be appended to the receive buffer of the remote peer.
Reimplemented from Ionflux::Tools::TCPClient. |