ITcpMsgEndPoint

Implemented by applications in order to be notified of connections as they are established by a TcpMsgClient or TcpMsgServer.

The methods of this interface are never called concurrently, and Release() is called last and exactly once.


struct ITcpMsgEndPoint
{
    virtual void Release() = 0;
    virtual void OnFailure(EEndPointFailureType type, std::error_code ec) = 0;
    virtual ITcpMsgSessionHandler* CreateSessionHandler(ITcpMsgSession&) = 0;
};


void Release()

The last call on the interface, can be used to destroy the object.


void OnFailure(EEndPointFailureType type, std::error_code ec)

Notification of a failure. The EEndPointFailureType parameter indicates what OS call produced the failure.


ITcpMsgSessionHandler* CreateSessionHandler(ITcpMsgSession&)

This function must create an object which implements the pure abstract interface ITcpMsgSessionHandler. Typically the created object will save the reference to the given ITcpMsgSession so it can request closing the session, or to cause message sending to recommence when there are more messages available to send.