Can you explain in more detail what's the difference between PIPE_READMODE_MESSAGE/PIPE_READMODE_BYTE?

后端 未结 2 1907
Happy的楠姐
Happy的楠姐 2021-02-19 07:06

Though I\'ve go through the document here, it still doesn\'t make sense to me what it is:

Data is read from the pipe as a stream of messages. This mode

2条回答
  •  太阳男子
    2021-02-19 07:27

    In BYTE mode, you are the one that needs to figure out the separation of the data so that it can be decoded at the receiving end. In MESSAGE mode, the API will do this for you. When you read the message on the other side you will have the whole block of data (the message).

    In both cases, you will still need some header data to wrap your message/data to know what it is if you are mixing data types sent through the pipe.

    EDIT: The documentation points to a very clear example of Client/Server using this API and the MESSAGE mode between both.

    http://msdn.microsoft.com/en-us/library/aa365592%28v=VS.85%29.aspx

    http://msdn.microsoft.com/en-us/library/aa365588%28v=VS.85%29.aspx

提交回复
热议问题