Table of Contents

Class ConnectionDataReceivedEventArgs

Namespace
WebDriverBiDi.Protocol
Assembly
WebDriverBiDi.dll

Object containing event data for events raised when data is received from a WebDriver BiDi connection.

public record ConnectionDataReceivedEventArgs : WebDriverBiDiEventArgs, IEquatable<WebDriverBiDiEventArgs>, IEquatable<ConnectionDataReceivedEventArgs>
Inheritance
ConnectionDataReceivedEventArgs
Implements
Inherited Members

Constructors

ConnectionDataReceivedEventArgs(IMemoryOwner<byte>, int)

Initializes a new instance of the ConnectionDataReceivedEventArgs class.

public ConnectionDataReceivedEventArgs(IMemoryOwner<byte> owner, int length)

Parameters

owner IMemoryOwner<byte>

The IMemoryOwner<T> whose buffer contains the received data. Ownership transfers to the consumer of this event, which is responsible for passing it to IncomingMessage for disposal.

length int

The number of valid bytes in the owner's buffer.

ConnectionDataReceivedEventArgs(ConnectionDataReceivedEventArgs)

protected ConnectionDataReceivedEventArgs(ConnectionDataReceivedEventArgs original)

Parameters

original ConnectionDataReceivedEventArgs

Properties

BufferOwner

Gets the IMemoryOwner<T> that owns the buffer containing the received data.

public IMemoryOwner<byte> BufferOwner { get; }

Property Value

IMemoryOwner<byte>

Data

Gets the data received from the connection as a read-only slice of the owner's buffer.

public ReadOnlyMemory<byte> Data { get; }

Property Value

ReadOnlyMemory<byte>

DataLength

Gets the number of valid bytes in the owner's buffer.

public int DataLength { get; }

Property Value

int

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(ConnectionDataReceivedEventArgs?)

public virtual bool Equals(ConnectionDataReceivedEventArgs? other)

Parameters

other ConnectionDataReceivedEventArgs

Returns

bool

Equals(WebDriverBiDiEventArgs?)

public override sealed bool Equals(WebDriverBiDiEventArgs? other)

Parameters

other WebDriverBiDiEventArgs

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

Prints the members of these event arguments for ToString(): those of the base record, and DataLength.

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

The builder to print the members to.

Returns

bool

true, because members were printed.

Remarks

Data and BufferOwner are deliberately not printed. The buffer is pooled memory that the consumer of the event disposes once it has processed the message, after which reading Data throws ObjectDisposedException, so printing it would make ToString() throw.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ConnectionDataReceivedEventArgs?, ConnectionDataReceivedEventArgs?)

public static bool operator ==(ConnectionDataReceivedEventArgs? left, ConnectionDataReceivedEventArgs? right)

Parameters

left ConnectionDataReceivedEventArgs
right ConnectionDataReceivedEventArgs

Returns

bool

operator !=(ConnectionDataReceivedEventArgs?, ConnectionDataReceivedEventArgs?)

public static bool operator !=(ConnectionDataReceivedEventArgs? left, ConnectionDataReceivedEventArgs? right)

Parameters

left ConnectionDataReceivedEventArgs
right ConnectionDataReceivedEventArgs

Returns

bool