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
The difference between PIPE_TYPE_BYTE
and PIPE_TYPE_MESSAGE
type mode are explained on the http://msdn.microsoft.com/en-us/library/aa365605.aspx:
Type Mode
The type mode of a pipe determines how data is written to a named pipe. Data can be transmitted through a named pipe as either a stream of bytes or as a stream of messages. The pipe server specifies the pipe type when calling CreateNamedPipe to create an instance of a named pipe. The type modes must be the same for all instances of a pipe.
To create a byte-type pipe, specify PIPE_TYPE_BYTE or use the default value. The data is written to the pipe as a stream of bytes, and the system does not differentiate between the bytes written in different write operations.
To create a message-type pipe, specify PIPE_TYPE_MESSAGE. The system treats the bytes written in each write operation to the pipe as a message unit. The system always performs write operations on message-type pipes as if write-through mode were enabled.
If you want to write a data stream with respect of pipes you should use PIPE_TYPE_BYTE
type mode. Then you can write any data in the pipe buffer with respect of WriteFile
and read there on the other side with respect of ReadFile
. How exactly the data will be send is not important for you. The data from some WriteFile
operation can be transfered as one data block.
If you use PIPE_TYPE_MESSAGE
type mode every write operation follows to the data transfer, because the writing in the pipe will be interpret as a sending of the message. There are a special function TransactNamedPipe
which allow you to write a message to and read a message from the specified named pipe into a single network operation.