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
ownerIMemoryOwner<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.
lengthintThe number of valid bytes in the owner's buffer.
ConnectionDataReceivedEventArgs(ConnectionDataReceivedEventArgs)
protected ConnectionDataReceivedEventArgs(ConnectionDataReceivedEventArgs original)
Parameters
originalConnectionDataReceivedEventArgs
Properties
BufferOwner
Gets the IMemoryOwner<T> that owns the buffer containing the received data.
public IMemoryOwner<byte> BufferOwner { get; }
Property Value
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
DataLength
Gets the number of valid bytes in the owner's buffer.
public int DataLength { get; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Methods
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Equals(ConnectionDataReceivedEventArgs?)
public virtual bool Equals(ConnectionDataReceivedEventArgs? other)
Parameters
Returns
Equals(WebDriverBiDiEventArgs?)
public override sealed bool Equals(WebDriverBiDiEventArgs? other)
Parameters
otherWebDriverBiDiEventArgs
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
builderStringBuilderThe builder to print the members to.
Returns
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
Operators
operator ==(ConnectionDataReceivedEventArgs?, ConnectionDataReceivedEventArgs?)
public static bool operator ==(ConnectionDataReceivedEventArgs? left, ConnectionDataReceivedEventArgs? right)
Parameters
Returns
operator !=(ConnectionDataReceivedEventArgs?, ConnectionDataReceivedEventArgs?)
public static bool operator !=(ConnectionDataReceivedEventArgs? left, ConnectionDataReceivedEventArgs? right)