Skip to content

PipeTransport

Namespace: PuppeteerSharp.Transport

public class PipeTransport : IConnectionTransport, IDisposable

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.

Inheritance: object

Implements: IConnectionTransport, IDisposable

View source

public PipeTransport(Stream pipeWrite, Stream pipeRead)

Initializes a new instance of the PipeTransport class.

Parameters

Name Type Description
pipeWrite Stream The stream to write messages to (browser reads from this).
pipeRead Stream The stream to read messages from (browser writes to this).

View source

public bool IsClosed { get; }

Gets a value indicating whether this IConnectionTransport is closed.

Value: bool

View source

public event EventHandler<TransportClosedEventArgs> Closed

Occurs when the transport is closed.

Value: EventHandler<TransportClosedEventArgs>

View source

public event EventHandler<MessageReceivedEventArgs> MessageReceived

Occurs when a message is received.

Value: EventHandler<MessageReceivedEventArgs>

View source

public void Dispose()

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

View source

protected virtual void Dispose(bool disposing)

Releases resources used by the PipeTransport.

Parameters

Name Type Description
disposing bool Whether disposal was initiated by Dispose().

View source

public Task SendAsync(byte[] message)

Sends a message using the transport.

Parameters

Name Type Description
message byte[] Message to send.

Returns: Task — The task.

View source

public void Start()

Starts the background receive loop.

View source

public void StopReading()

Stops reading incoming data.

View source

Made with love by Dario Kondratiuk