From 665b6bd135dbb657f43280da955137a7b62dca29 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 25 Jul 2018 20:00:57 -0400 Subject: update readme --- README.rst | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 5cf9366..64298de 100644 --- a/README.rst +++ b/README.rst @@ -26,26 +26,33 @@ Features Functionalities --------------- -- `ConnPool`: A byte level connection pool implementation, the `ConnPool::Conn` - (or `ConnPool::conn_t`) objects represent a connection to which one can - send/receive a binary stream of data asynchronously. - -- `MsgNetwork`: A message level network pool implementation, the - `MsgNetwork::Conn` (or `MsgNetwork::cont_t`) objects represent a channel to - which one can send/receive a predefined message. Message handler functions - are registered by `reg_handler()` and invoked upon receiving a new message. - `OpcodeType` is the type used for identifying message types. A vald message - type must have `opcode` value as its static member and `serialized` as a - member typed `DataStream` which contains the serialized data of the message. - -- `PeerNetwork`: A simple P2P network pool implementation. It will +- ``ConnPool``: byte level connection pool implementation, ``ConnPool::Conn`` (or + ``ConnPool::conn_t``) objects represent connections to which one can + send/receive a stream of binary data asynchronously. + +- ``MsgNetwork``: message level network pool implementation, + ``MsgNetwork::Conn`` (or ``MsgNetwork::cont_t``) objects represent channels to + which one can send/receive predefined messages asynchronously. Message + handler functions are registered by ``reg_handler()`` and invoked upon + receiving a new message. ``OpcodeType`` is the type used for identifying + message types. A valid message class must have: + + - a static member ``opcode`` typed ``OpcodeType`` as the message type identifier + - a member ``serialized`` typed ``DataStream`` which contains the serialized data + of the message. + + - a constructor ``MsgType(DataStream &&)`` that parse the message from stream. + +Based on ``MsgNetwork``, salticidae provides the following higher level abstractions: + +- ``PeerNetwork``: simple P2P network pool implementation. It will ensure exactly one underlying bi-directional connection is established per added peer, and retry the connection when it is broken. Ping-pong messages - are utilized to test the connectivity at the application layer. + are utilized to test the connectivity periodically. -- `ClientNetwork`: A simple client-server network pool - implementation. A server who initialy calls `listen()` will accept the - incoming client messages, while a client simply calls `connect()` to connect +- ``ClientNetwork``: simple client-server network pool + implementation. A server who initially calls ``listen()`` will accept the + incoming client messages, while a client simply calls ``connect()`` to connect to a known server. Dependencies -- cgit v1.2.3