Table of Contents

Class PipeTransport

Namespace
PuppeteerSharp.Transport
Assembly
PuppeteerSharp.dll

Transport implementation using pipes for browser communication. Used with Chrome's --remote-debugging-pipe flag, which communicates via file descriptors 3 (browser reads) and 4 (browser writes). Messages are null-terminated (\0) JSON strings.

public class PipeTransport : IConnectionTransport, IDisposable
Inheritance
PipeTransport
Implements

Constructors

PipeTransport(Stream, Stream)

Initializes a new instance of the PipeTransport class.

public PipeTransport(Stream pipeWrite, Stream pipeRead)

Parameters

pipeWrite Stream

The stream to write messages to (browser reads from this).

pipeRead Stream

The stream to read messages from (browser writes to this).

Properties

IsClosed

Gets a value indicating whether this IConnectionTransport is closed.

public bool IsClosed { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases resources used by the PipeTransport.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Whether disposal was initiated by Dispose().

SendAsync(byte[])

Sends a message using the transport.

public Task SendAsync(byte[] message)

Parameters

message byte[]

Message to send.

Returns

Task

The task.

Start()

Starts the background receive loop.

public void Start()

StopReading()

Stops reading incoming data.

public void StopReading()

Events

Closed

Occurs when the transport is closed.

public event EventHandler<TransportClosedEventArgs> Closed

Event Type

EventHandler<TransportClosedEventArgs>

MessageReceived

Occurs when a message is received.

public event EventHandler<MessageReceivedEventArgs> MessageReceived

Event Type

EventHandler<MessageReceivedEventArgs>