PipeTransport
Namespace: PuppeteerSharp.Transport
public class PipeTransport : IConnectionTransport, IDisposableTransport 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
Constructors
Section titled “Constructors”PipeTransport(Stream, Stream)
Section titled “PipeTransport(Stream, Stream)”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). |
Properties
Section titled “Properties”IsClosed
Section titled “IsClosed”public bool IsClosed { get; }Gets a value indicating whether this IConnectionTransport is closed.
Value: bool
Events
Section titled “Events”Closed
Section titled “Closed”public event EventHandler<TransportClosedEventArgs> ClosedOccurs when the transport is closed.
Value: EventHandler<TransportClosedEventArgs>
MessageReceived
Section titled “MessageReceived”public event EventHandler<MessageReceivedEventArgs> MessageReceivedOccurs when a message is received.
Value: EventHandler<MessageReceivedEventArgs>
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Dispose(bool)
Section titled “Dispose(bool)”protected virtual void Dispose(bool disposing)Releases resources used by the PipeTransport.
Parameters
| Name | Type | Description |
|---|---|---|
disposing |
bool | Whether disposal was initiated by Dispose(). |
SendAsync(byte[])
Section titled “SendAsync(byte[])”public Task SendAsync(byte[] message)Sends a message using the transport.
Parameters
| Name | Type | Description |
|---|---|---|
message |
byte[] | Message to send. |
Returns: Task — The task.
Start()
Section titled “Start()”public void Start()Starts the background receive loop.
StopReading()
Section titled “StopReading()”public void StopReading()Stops reading incoming data.
Made with love by Dario Kondratiuk