Table of Contents

Interface IConnection

Namespace
Ecng.Net
Assembly
Ecng.Net.SocketIO.dll

Defines a standard contract for a connection that can be established and disconnected.

public interface IConnection
Extension Methods

Methods

ConnectAsync(CancellationToken)

Asynchronously connects to a target.

ValueTask ConnectAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

ValueTask

A task representing the asynchronous operation.

Disconnect()

Disconnects the current connection.

void Disconnect()

Events

StateChanged

Occurs when the connection state has changed.

event Action<ConnectionStates> StateChanged

Event Type

Action<ConnectionStates>