Pipe – pipe handle

class uv.Pipe(ipc=False, loop=None, on_read=None, on_connection=None)[source]

Stream interface to local domain sockets on Unix and named pipes on Windows, which supports inter process communication.

open(fd)[source]

Open an existing file descriptor as a pipe.

Raises:
  • uv.UVError – error while opening the file descriptor
  • uv.ClosedHandleError – handle has already been closed or is closing
Parameters:

fd (int) – file descriptor

bind(path)[source]

Bind the pipe to a file path (Unix) or a name (Windows).

Raises:
  • uv.UVError – error while binding to path
  • uv.ClosedHandleError – handle has already been closed or is closing
Parameters:

path (unicode) – path or name to bind to to bind to

connect(path, on_connect=None)[source]

Connect to the given Unix domain socket or named pipe.

Raises:

uv.ClosedHandleError – handle has already been closed or is closing

Parameters:
  • path (unicode) – path to connect to
  • on_connect (Callable[[uv.PipeConnectRequest, uv.StatusCode], None]:rtype: uv.PipeConnectRequest) – callback which should run after a connection has been established or on error
pending_count

Number of pending streams to receive over IPC.

Readonly:True
Return type:int
pending_type

Type of first pending stream, if there is a pending stream. Returns a subclass of uv.Stream.

Readonly:True
Return type:type | None
pending_accept(*arguments, **keywords)[source]

Accept a pending stream.

Raises:
  • uv.UVError – error while accepting stream
  • uv.ClosedHandleError – handle has already been closed or is closing
Return type:

uv.Stream

pending_instances(amount)[source]

Set the number of pending pipe instance handles when the pipe server is waiting for connections.

Note

This setting applies to Windows only.

Raises:uv.ClosedHandleError – handle has already been closed or is closing
Parameters:amount (int) – amount of pending instances
sockname

Name of the Unix domain socket or the named pipe.

Raises:
  • uv.UVError – error while receiving sockname
  • uv.ClosedHandleError – handle has already been closed or is closing
Readonly:

True

Return type:

unicode

peername

Name of the Unix domain socket or the named pipe to which the handle is connected.

Raises:
  • uv.UVError – error while receiving peername
  • uv.ClosedHandleError – handle has already been closed or is closing
Readonly:

True

Return type:

unicode

class uv.PipeConnectRequest(pipe, path, on_connect=None)[source]

Pipe specific connect request.