Connection implementation classes and data
The implementation objects for connections.
More...
|
Classes |
class | BiDirConn |
| A bidirectional (incoming and outgoing) connection. More...
|
class | Connection |
| The top-level class for any type of connection. More...
|
class | Outlet |
| Provides the interface to output data on a connection. More...
|
Detailed Description
The implementation objects for connections.
Connection objects have the following responsibilities:
- Take a Connector, and set up a reader and writer thread to handle I/O over that Connector.
- Handle disconnection of its Connector, letting MasterController know about the event.
- Gracefully shuts down the threads and disconnect its Connector when instructed to do so.
Connections that implement writing have these additional responsibilities:
- Maintain a queue of data waiting to be written out.
- Accept Messages from other Connections or the MasterController, and act on them as appropriate. Messages containing data will cause that data to be appended to the write queue.
And, finally, Connections that implement reading have these additional responsibilities:
- Read data from the Connector, interprets it according to a configured protocol, and sends a Message containing the interpreted data or other message to all its Outlets.
In the future, Connections will also reconnect when instructed to do so.