| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
For full details on the Windows named pipes API see https://docs.microsoft.com/en-us/windows/desktop/ipc/named-pipes
| :: String | A unique pipe name of the form |
| -> OpenMode | |
| -> PipeMode | |
| -> DWORD | nMaxInstances |
| -> DWORD | nOutBufferSize |
| -> DWORD | nInBufferSize |
| -> DWORD | nDefaultTimeOut |
| -> Maybe LPSECURITY_ATTRIBUTES | |
| -> IO HANDLE |
Creates an instance of a named pipe and returns a handle for subsequent pipe operations. A named pipe server process uses this function either to create the first instance of a specific named pipe and establish its basic attributes or to create a new instance of an existing named pipe.
For full details see https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createnamedpipea
To create a named pipe which can be associate with IO completion port on needs to pass fILE_FLAG_OVERLAPPED to OpenMode argument, e.g.
Win32.createNamedPipe pipeName
(pIPE_ACCESS_DUPLEX .|. fILE_FLAG_OVERLAPPED)
(pIPE_TYPE_BYTE .|. pIPE_READMODE_BYTE)
pIPE_UNLIMITED_INSTANCES
512
512
0
NothinROR
pIPE_UNLIMITED_INSTANCES :: DWORD Source
type LPSECURITY_ATTRIBUTES = Ptr SECURITY_ATTRIBUTES Source
The named pipe open mode.
This must specify one of:
It may also specify:
It may also specify any combination of:
pIPE_ACCESS_DUPLEX :: OpenMode Source
pIPE_ACCESS_INBOUND :: OpenMode Source
pIPE_ACCESS_OUTBOUND :: OpenMode Source
fILE_FLAG_OVERLAPPED :: FileAttributeOrFlag Source
The pipe mode.
One of the following type modes can be specified. The same type mode must be specified for each instance of the pipe.
One of the following read modes can be specified. Different instances of the same pipe can specify different read modes.
One of the following wait modes can be specified. Different instances of the same pipe can specify different wait modes.
One of the following remote-client modes can be specified. Different instances of the same pipe can specify different remote-client modes.
pIPE_ACCEPT_REMOTE_CLIENTpIPE_REJECT_REMOTE_CLIENTpIPE_TYPE_BYTE :: PipeMode Source
pIPE_TYPE_MESSAGE :: PipeMode Source
pIPE_READMODE_BYTE :: PipeMode Source
pIPE_READMODE_MESSAGE :: PipeMode Source
pIPE_NOWAIT :: PipeMode Source
pIPE_ACCEPT_REMOTE_CLIENTS :: PipeMode Source
If the createNamedPipe nMaxInstances parameter is pIPE_UNLIMITED_INSTANCES, the number of pipe instances that can be created is limited only by the availability of system resources.
pIPE_REJECT_REMOTE_CLIENTS :: PipeMode Source
| :: String | file name |
| -> AccessMode | dwDesiredAccess |
| -> ShareMode | dwSharedMode |
| -> Maybe LPSECURITY_ATTRIBUTES | lpSecurityAttributes |
| -> CreateMode | dwCreationDisposition |
| -> FileAttributeOrFlag | dwFlagsAndAttributes |
| -> Maybe HANDLE | hTemplateFile |
| -> IO HANDLE |
A reliable connect call, as designed in https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipe-client
The arguments are passed directly to createFile.
Note we pick the more familiar posix naming convention, do not confuse this function with connectNamedPipe (which corresponds to posix accept)
Wait until a named pipe instance is available. If there is no instance at hand before the timeout, it will error with ERROR_SEM_TIMEOUT, i.e. invalid argument (The semaphore timeout period has expired)
It returns True if there is an available instance, subsequent createFile might still fail, if another thread will take turn and connect before, or if the other end shuts down the name pipe.
It returns False if timeout fired.
Timeout in milliseconds.
nMPWAIT_USE_DEFAULT_WAIT indicates that the timeout value passed to createNamedPipe should be used.nMPWAIT_WAIT_FOREVER - waitNamedPipe will block forever, until a named pipe instance is available.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/Win32-2.14.1.0-d391/System-Win32-NamedPipes.html