Sys2CreateNamedPipe
Creates a named pipe with the specified name and parameters. Only byte mode is supported; message mode is not.
Note that the standard REXX functions such as CHARIN/OUT, which operate directly on file names, are not capable of using the pipe handle returned from this function. While the client end can use such functions after using STREAM to issue an OPEN WRITE or OPEN READ command, the server end needs to use the pipe handle from this function, and must therefore use Sys2Read/Sys2Write in order to read and write data from the pipe.
Named pipes can be created in inbound-only, outbound-only, or duplex (inbound/outbound) mode. An error will result if attempting to write to an inbound-only pipe, or read from an outbound-only pipe.
To activate a named pipe so that client processes can connect to it, use Sys2ConnectNamedPipe. To check the pipe's connection status, as well as the amount of data currently in the pipe, use Sys2CheckNamedPipe. To unlock a named pipe after a client has closed the connection, use Sys2DisconnectNamedPipe. Finally, the pipe can be destroyed using Sys2Close.
Arguments
- The name of the pipe, in the form "\PIPE\something". (REQUIRED)
- The size of the outbound buffer, in bytes. (REQUIRED)
- The size of the inbound buffer, in bytes. (REQUIRED)
- The pipe's timeout value, in milliseconds. (DEFAULT: 3000)
- The number of simultaneous instances of this pipe which are allowed. Must be between 1 and 254, or 0 indicating no limit. (DEFAULT: 1)
- Pipe blocking mode, one of:
- W = WAIT mode, read and write block waiting for data (DEFAULT)
- N = NOWAIT mode, read and write return immediately
- Pipe mode, one of:
- I = Inbound pipe (DEFAULT)
- O = Outbound pipe
- D = Duplex (inbound/outbound) pipe
- Privacy/inheritance flag, one of:
- 0 = The pipe handle is inherited by child processes (DEFAULT)
- 1 = The pipe handle is private to the current process
- Write-through flag, one of:
- 0 = Allow delayed writes (write-behind) to remote pipes (DEFAULT)
- 1 = Force immediate writes (write-through) to remote pipes
Return Value
A four-byte pipe handle.