TcpMsgClient

TcpMsgClient is implemented by the cxMessage2 library to represent a client that will try to establish a socket connection with a given TcpMsgServer.

It will try to ensure there is always one connection - if the connection fails it will automatically reconnect.

To close the connection you need to close the TcpMsgClient.



TcpMsgClient* CreateTcpMsgClient(
    IoContextPool* pool,
    const char* host,
    const char* service,
    ITcpMsgEndPoint& ep,
    const TcpMsgSessionSettings& sessionSettings)

Create a client that will connect to the given host with the given service. It will use the given IoContextPool.

For each successful connection the given ITcpMsgEndPoint is used to process socket connections as they are made.

The given TcpMsgSessionSettings are used for each created TcpMsgSession.

Never returns nullptr.


void Close(TcpMsgClient*)

Close the given TcpMsgClient.