|
| ConnectionHub (uint32_t id) |
|
| ConnectionHub (Socket socket, const SockaddrIn &addr) |
|
virtual bool | processOutgoing () override |
|
virtual bool | processIncoming () override |
| Manages accepting incoming connections when this connection is a listener.
|
|
| ConnectionTCP () |
|
| ConnectionTCP (Socket socket, const SockaddrIn &addr) |
| Constructs a connection that is attached to the specified socket.
|
|
virtual | ~ConnectionTCP () |
| Destroys this connection.
|
|
SocketType | type () const override |
|
IPProto | proto () const override |
|
void | enableAutoReconnect () |
|
void | disableAutoReconnect () |
|
virtual bool | isAutoConnectEnabled () const override |
|
virtual bool | isConnected () const override |
|
void | setConnectTimeout (int64_t milliseconds) |
|
void | setNoDelay (bool val=true) |
| Set the TCP_NODELAY flag (Enable / Disables Nagles algorithm).
|
|
void | shutdown () |
| Shutdown this connection.
|
|
virtual bool | connect (const SockaddrIn &addr) |
| Sets up this connection ready to connect to the specified remote address and port.
|
|
virtual bool | reconnect () override |
| Reconnects this connection to the remote host previously specified through a call to connect.
|
|
virtual bool | disconnect () override |
| Disconnects this connection.
|
|
bool | listen (uint16_t port) |
|
bool | listen (AddrIn ip, uint16_t port) |
| Sets this connection up as a listener that will listen for and respond to incoming connection requests on the specified port.
|
|
virtual bool | processIncoming () override |
| Manages accepting incoming connections when this connection is a listener.
|
|
virtual ConnectionTCP * | accept (Socket, const SockaddrIn &) |
|
| ConnectionBase () |
|
virtual | ~ConnectionBase () |
|
Family | family () const |
|
virtual SocketType | type () const =0 |
|
virtual IPProto | proto () const =0 |
|
Socket | getSocket () const |
|
void | remove () |
|
void | removeAndDelete () |
|
const SockaddrIn & | getAddress () const |
|
int64_t | getReconnectTime () const |
|
virtual bool | isAutoConnectEnabled () const |
|
virtual bool | isConnected () const |
|
bool | shouldRemove () const |
|
bool | shouldDelete () const |
|
void | setNonblocking (bool val=true) |
| Sets socket non-blocking mode to val.
|
|
void | setDoNotProcess () |
|
virtual bool | reconnect () |
|
virtual bool | disconnect ()=0 |
|
bool | bind (uint16_t port) |
|
virtual bool | bind (AddrIn ip, uint16_t port) |
| Sets this connection up as a listener that will listen for and respond to incoming connection requests on the specified port.
|
|
bool | send (const void *data, uint64_t byteCount, uint64_t &bytesSent) |
| Attempts to send as much of the specified data as possible.
|
|
bool | receive (void *buffer, uint64_t byteCount, uint64_t &bytesReceived) |
| Attempts to read the specified number of bytes from the network socket this connection represents.
|
|
bool | sendTo (const void *data, uint64_t byteCount, uint64_t &bytesSent, const SockaddrIn &addr) |
| Attempts to send as much of the specified data as possible.
|
|
bool | recvFrom (void *buffer, uint64_t byteCount, uint64_t &bytesReceived, SockaddrIn &addr) |
| Attempts to read the specified number of bytes from the network socket this connection represents.
|
|
virtual bool | processOutgoing () |
|
virtual bool | processIncoming () |
|
| MessageHub (uint32_t ident=0) |
| Constructs a new MessageHub instance and adds it to the global hub list.
|
|
virtual | ~MessageHub () |
| Removes this MessageHub from the global list and cleans up all connections to and from this hub.
|
|
bool | addListener (MessageHub *hub, bool bidirectional=false) |
| Adds the specified hub as a listener to this hub.
|
|
bool | addListener (uint32_t hubid, bool bidirectional=false) |
| Attempts to add the hub with the given ID as a listener to this hub.
|
|
bool | listenTo (MessageHub *hub, bool bidirectional=false) |
| Sets this MessageHub up to listen for messages from the specified hub.
|
|
bool | listenTo (uint32_t hubid, bool bidirectional=false) |
| Sets up this MessageHub to listen for messages from the hub with the specified ID (if a matching hub can be found).
|
|
bool | removeListener (MessageHub *hub) |
| Removes the specified hub as a listener to this hub.
|
|
bool | removeListener (uint32_t hubid) |
| Removes the hub with the given ID as a listener to this hub.
|
|
void | removeAllListeners () |
| Removes all listeners from this hub.
|
|
void | disconnectFromSender (uint32_t hubid) |
| Disconnects this hub from the specified hub to which it is listening.
|
|
void | disconnectFromAllSenders () |
| Disconnects this hub from all hubs to which it is listening.
|
|
virtual void | broadcastMessage (const Message::Ptr &message) |
| Broadcast message to all hubs.
|
|
virtual void | sendMessage (const Message::Ptr &message) |
| Send message to all hubs listening to this one.
|
|
virtual void | queueMessage (const Message::Ptr &message) |
| Queue a message for this hub to process.
|
|
virtual bool | processMessages (size_t limit=noLimit) |
| Process all queued messages for this hub.
|
|
virtual bool | isSendOnly () const |
|
uint32_t | getID () const |
|
size_t | getNoOfQueuedMessages () |
| Retrieves the number of messages currently awaiting processing by this hub.
|
|
void | flushQueuedMessages () |
| Flushes all pending messages from this hub without processing them.
|
|
A ConnectionHub combines a TCP connection with a MessageHub to enable the forwarding and receiving of messages over a network connection.
Queued messages in the hub will be transmitted over the network. Received messages will be forwarded to local listeners for processing.