Named Pipe - in Windows

In Windows

In Windows, the design of named pipes is based towards client-server communication, and they work much like sockets, other than the usual read and write operations. Windows named pipes also support an explicit "passive" mode for server applications (compare: Unix domain sockets). Windows 95 supports named pipe clients. The Windows NT family of operating systems support named pipe clients and servers.

A named pipe can be accessed much like a file. Win32 SDK functions CreateFile, ReadFile, WriteFile and CloseHandle open, read from, write to, and close a pipe, respectively. There is no command line interface like in Unix.

Named pipes cannot be mounted within a normal filesystem, unlike in Unix. Also unlike their Unix counterparts, named pipes are volatile (removed after the last reference to them is closed). Every pipe is placed in the root directory of the named pipe filesystem (NPFS), mounted under the special path \\.\pipe\ (that is, a pipe named "foo" would have a full path name of \\.\pipe\foo). Anonymous pipes used in pipelining are actually named pipes with a random name.

They are very rarely seen by users, but there are notable exceptions. The VMware Workstation PC hardware virtualization tool, for instance, can expose emulated serial ports to the host system as named pipes, and the WinDbg kernel mode debugger from Microsoft supports named pipes as a transport for debugging sessions (in fact, VMware and WinDbg can be coupled together - since WinDbg normally requires a serial connection to the target computer - letting driver developers do their development and testing on a single computer). Both programs require the user to enter names in the \\.\pipe\name form.

Windows NT Named Pipes can inherit a security context.

Summary of named pipes on Microsoft Windows:

  • Intermachine and Intramachine IPC
  • Half-duplex or full-duplex
  • Byte-oriented or Message-oriented
  • Reliable
  • Blocking or Nonblocking read and write (choosable)
  • Standard device I/O handles (FileRead, FileWrite)
  • Namespace used to create handles
  • Inefficient WAN traffic (explicit data transfer request, unlike e.g. TCP/IP sliding window, etc.)
  • Peekable reads (read without removing from pipe's input buffer)

The .NET Framework 3.5 has added named pipe support.

Named pipes can also be used as an endpoint in Microsoft SQL Server.

Named pipes is also a networking protocol in the Server Message Block (SMB) suite, based on the use of a special inter-process communication (IPC) share. SMB's IPC can seamlessly and transparently pass the authentication context of the user across to Named Pipes. Windows NT's entire NT Domain protocol suite of services are implemented as DCE/RPC service over Named Pipes, as are the Exchange 5.5 Administrative applications.

Read more about this topic:  Named Pipe

Famous quotes containing the word windows:

    I know some lonely houses off the road
    A robber’d like the look of,—
    Wooden barred,
    And windows hanging low,
    Emily Dickinson (1830–1886)

    Among a hundred windows shining
    dully in the vast side
    of greater-than-palace number such-and-such
    one burns
    these several years, each night
    as if the room within were aflame.
    Denise Levertov (b. 1923)