WriteMessageResult

Return value for calls to WriteMessage on a ITcpMsgSessionHandler.


struct WriteMessageResult
{
    enum
    {
        NoMessage = -1,
        ShutdownSending = -2
    };

    ssize_t payloadSize;
    ssize_t nextPayloadSize;
};


ssize_t payloadSize

Values Description
> 0 payloadSize represents the size of the message just written by the call to WriteMessage(). This must not exceed the value of payloadSizeAvailable passed into WriteMessage().
0 No message was written - either because there is none currently available or because payloadSizeAvailable was too small


ssize_t nextPayloadSize

Values Description
>= 0 Indicates a request for another call to WriteMessage with payloadSizeAvailable (at least) as large as nextPayloadSize
NoMessage (-1) Currently there are no more messages ready to be sent.
ShutdownSending (-2) There are no more messages to be sent, and there never will be. (this causes a shutdown of sending on the associated socket so that the other end will read end-of-stream)