Group: Pipe - Library: kernel32
Sets the read mode and the blocking mode of the specified named pipe. If the specified handle is to the client end of a named pipe and if the named pipe server process is on a remote computer, the function can also be used to control local buffering.
Using named pipes for interprocess communication
BOOL SetNamedPipeHandleState(
HANDLE hNamedPipe,
LPDWORD lpMode,
LPDWORD lpMaxCollectionCount,
LPDWORD lpCollectDataTimeout
);
DECLARE INTEGER SetNamedPipeHandleState IN kernel32;
INTEGER hNamedPipe,;
LONG @lpMode,;
LONG lpMaxCollectionCount,;
LONG lpCollectDataTimeout
hNamedPipe [in] A handle to the named pipe instance.
[in] The new pipe mode. The mode is a combination of a read-mode flag and a wait-mode flag.
lpMaxCollectionCount [in] The maximum number of bytes collected on the client computer before transmission to the server.
lpCollectDataTimeout [in] The maximum time, in milliseconds, that can pass before a remote named pipe transfers information over the network.
If the function succeeds, the return value is nonzero.
This is a part of pipe client code
hPipe = CreateFile(cPipename,;
BITOR(GENERIC_WRITE, GENERIC_READ),;
0, 0, OPEN_EXISTING, 0, 0)
IF hPipe <> INVALID_HANDLE_VALUE
nPipeMode = PIPE_READMODE_MESSAGE
nResult = SetNamedPipeHandleState(m.hPipe,;
@nPipeMode, 0, 0)
ENDIF