Class Connection
Inheritance
object
Connection
Assembly: Xrpl.dll
Syntax
Constructors
|
Edit this page
View Source
Connection(string, ConnectionOptions?)
Declaration
public Connection(string server, Connection.ConnectionOptions? options = null)
Parameters
Fields
|
Edit this page
View Source
connectionManager
Declaration
public ConnectionManager connectionManager
Field Value
|
Edit this page
View Source
requestManager
Declaration
public RequestManager requestManager
Field Value
|
Edit this page
View Source
timer
Declaration
Field Value
|
Edit this page
View Source
ws
Declaration
public volatile WebSocketClient ws
Field Value
Properties
|
Edit this page
View Source
CurrentConnectionState
Declaration
public XrpConnectionState CurrentConnectionState { get; }
Property Value
|
Edit this page
View Source
DroppedStreamMessages
How many stream messages have been discarded because the consumer fell behind.
Declaration
public long DroppedStreamMessages { get; }
Property Value
|
Edit this page
View Source
FallbackDispatchedStreamMessages
How many stream frames were dispatched outside the queue.
Declaration
public long FallbackDispatchedStreamMessages { get; }
Property Value
|
Edit this page
View Source
StaleSessionFramesDropped
How many stream frames were discarded because they came from a session that is no longer
active.
Declaration
public long StaleSessionFramesDropped { get; }
Property Value
|
Edit this page
View Source
config
Declaration
public Connection.ConnectionOptions config { get; }
Property Value
|
Edit this page
View Source
url
Declaration
public string url { get; }
Property Value
Methods
|
Edit this page
View Source
Base64Decode(string)
Declaration
public static string Base64Decode(string base64EncodedData)
Parameters
| Type |
Name |
Description |
| string |
base64EncodedData |
|
Returns
|
Edit this page
View Source
Base64Encode(string)
Declaration
public static string Base64Encode(string plainText)
Parameters
| Type |
Name |
Description |
| string |
plainText |
|
Returns
|
Edit this page
View Source
ChangeServer(string, ConnectionOptions?, CancellationToken)
Moves the client to another server: retires the current session and connects to
server.
Declaration
public Task ChangeServer(string server, Connection.ConnectionOptions? options = null, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Connect(CancellationToken)
Declaration
public Task Connect(CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| CancellationToken |
cancellationToken |
|
Returns
|
Edit this page
View Source
Disconnect()
Declaration
public Task<int> Disconnect()
Returns
| Type |
Description |
| Task<int> |
|
|
Edit this page
View Source
DisconnectAndWaitAsync(TimeSpan, CancellationToken)
Disconnects and waits for the WebSocket to be fully closed and cleaned up.
Declaration
public Task DisconnectAndWaitAsync(TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| TimeSpan |
timeout |
Maximum time to wait for cleanup.
|
| CancellationToken |
cancellationToken |
Cancellation token.
|
Returns
|
Edit this page
View Source
GRequest<T, R>(R, TimeSpan?, RequestFailurePolicy?, CancellationToken)
Declaration
public Task<XrplResponse<T>> GRequest<T, R>(R request, TimeSpan? timeout = null, RequestFailurePolicy? policyOverride = null, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| R |
request |
|
| TimeSpan? |
timeout |
|
| RequestFailurePolicy? |
policyOverride |
|
| CancellationToken |
cancellationToken |
|
Returns
Type Parameters
|
Edit this page
View Source
GetUrl()
Declaration
Returns
|
Edit this page
View Source
HasConnectionAsync(TimeSpan?)
Declaration
public Task<bool> HasConnectionAsync(TimeSpan? timeout = null)
Parameters
| Type |
Name |
Description |
| TimeSpan? |
timeout |
|
Returns
| Type |
Description |
| Task<bool> |
|
|
Edit this page
View Source
IsConnected()
Declaration
public bool IsConnected()
Returns
|
Edit this page
View Source
OnMessage(string)
Declaration
public Task OnMessage(string message)
Parameters
| Type |
Name |
Description |
| string |
message |
|
Returns
|
Edit this page
View Source
Request(Dictionary<string, object>, TimeSpan?, RequestFailurePolicy?, CancellationToken)
Declaration
public Task<XrplResponse<Dictionary<string, object>>> Request(Dictionary<string, object> request, TimeSpan? timeout = null, RequestFailurePolicy? policyOverride = null, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| Dictionary<string, object> |
request |
|
| TimeSpan? |
timeout |
|
| RequestFailurePolicy? |
policyOverride |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<XrplResponse<Dictionary<string, object>>> |
|
|
Edit this page
View Source
State()
Declaration
public WebSocketState State()
Returns
| Type |
Description |
| WebSocketState |
|
|
Edit this page
View Source
WaitForConnectionAsync(TimeSpan?, CancellationToken)
Declaration
public Task WaitForConnectionAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| TimeSpan? |
timeout |
|
| CancellationToken |
cancellationToken |
|
Returns
|
Edit this page
View Source
WaitForConnectionOutcomeAsync(TimeSpan?, CancellationToken)
How a wait for the connection ended.
Declaration
public Task<ConnectionWaitOutcome> WaitForConnectionOutcomeAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| TimeSpan? |
timeout |
|
| CancellationToken |
cancellationToken |
|
Returns
|
Edit this page
View Source
WebsocketSendAsync(WebSocketClient, string)
Sends a message through the WebSocket connection, fire-and-forget.
Declaration
public void WebsocketSendAsync(WebSocketClient ws, string message)
Parameters
| Type |
Name |
Description |
| WebSocketClient |
ws |
The WebSocket client to send through.
|
| string |
message |
The message to send.
|
Exceptions
Events
|
Edit this page
View Source
OnBookChanges
Declaration
public event OnBookChanges OnBookChanges
Event Type
|
Edit this page
View Source
OnConnected
Declaration
public event OnConnected OnConnected
Event Type
|
Edit this page
View Source
OnConnectionStatus
Declaration
public event Action<ConnectionStatusInfo> OnConnectionStatus
Event Type
|
Edit this page
View Source
OnConsensusPhase
Declaration
public event OnConsensusPhase OnConsensusPhase
Event Type
|
Edit this page
View Source
OnDisconnect
Declaration
public event OnDisconnect OnDisconnect
Event Type
|
Edit this page
View Source
OnError
Declaration
public event OnError OnError
Event Type
|
Edit this page
View Source
OnLedgerClosed
Declaration
public event OnLedgerClosed OnLedgerClosed
Event Type
|
Edit this page
View Source
OnManifestReceived
Declaration
public event OnManifestReceived OnManifestReceived
Event Type
|
Edit this page
View Source
OnPathFind
Declaration
public event OnPathFind OnPathFind
Event Type
|
Edit this page
View Source
OnPeerStatusChange
Declaration
public event OnPeerStatusChange OnPeerStatusChange
Event Type
|
Edit this page
View Source
OnPing
Declaration
public event OnPing OnPing
Event Type
|
Edit this page
View Source
OnServerStatus
Declaration
public event OnServerStatus OnServerStatus
Event Type
|
Edit this page
View Source
OnServerWarning
Declaration
public event OnServerWarning OnServerWarning
Event Type
|
Edit this page
View Source
OnSessionEnded
The connection that carried the subscriptions has ended - by any route.
Declaration
public event OnSessionEnded OnSessionEnded
Event Type
|
Edit this page
View Source
OnTransaction
Declaration
public event OnTransaction OnTransaction
Event Type
|
Edit this page
View Source
OnValidationReceived
Declaration
public event OnValidationReceived OnValidationReceived
Event Type
|
Edit this page
View Source
OnWarning
Declaration
public event OnWarning OnWarning
Event Type