Show / Hide Table of Contents

Class WebSocketClient

Inheritance
object
WebSocketClient
Namespace: Xrpl.Client
Assembly: Xrpl.dll
Syntax
public class WebSocketClient

Constructors

| Edit this page View Source

WebSocketClient(string)

Declaration
protected WebSocketClient(string uri)
Parameters
Type Name Description
string uri

Fields

| Edit this page View Source

IsDisposed

Declaration
public bool IsDisposed
Field Value
Type Description
bool

Properties

| Edit this page View Source

FailureReason

Declaration
public SocketFailureReason FailureReason { get; }
Property Value
Type Description
SocketFailureReason
| Edit this page View Source

State

Get the current state of the WebSocket client.

Declaration
public WebSocketState State { get; }
Property Value
Type Description
WebSocketState

Methods

| Edit this page View Source

Cancel()

Cancel work without setting intentional disconnect flag. Use CancelIntentionally() for user-initiated cancellations.

Declaration
public void Cancel()
| Edit this page View Source

CancelIntentionally()

Cancel work as an intentional disconnect. Sets the intentional disconnect flag before cancelling. Use this for user-initiated disconnects.

Declaration
public void CancelIntentionally()
| Edit this page View Source

Connect()

Connects to the WebSocket server.

Declaration
public Task<WebSocketClient> Connect()
Returns
Type Description
Task<WebSocketClient>

Self

| Edit this page View Source

Create(string)

Creates a new instance.

Declaration
public static WebSocketClient Create(string uri)
Parameters
Type Name Description
string uri

The URI of the WebSocket server.

Returns
Type Description
WebSocketClient

Instance of the created WebSocketWrapper

| Edit this page View Source

Dispose()

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

Declaration
public void Dispose()
| Edit this page View Source

ResetIntentionalDisconnect()

Resets the intentional disconnect flag to false. Called after successful connection to enable error detection.

Declaration
public void ResetIntentionalDisconnect()
| Edit this page View Source

SendMessage(string)

Send a UTF8 string to the WebSocket server.

Declaration
public void SendMessage(string message)
Parameters
Type Name Description
string message

The message to send

| Edit this page View Source

SetIntentionalDisconnect()

Sets the intentional disconnect flag to true without cancelling. Use this before Cancel() if you need to set the flag earlier.

Declaration
public void SetIntentionalDisconnect()
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX