Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
Loading...
Searching...
No Matches
Nakama.WebSocketStdlibAdapter Class Reference

An adapter which uses the WebSocket protocol with Nakama server. More...

Inheritance diagram for Nakama.WebSocketStdlibAdapter:
Nakama.ISocketAdapter

Public Member Functions

 WebSocketStdlibAdapter (int sendTimeoutSec=SendTimeoutSec, int maxMessageReadSize=MaxMessageReadSize)
 
 WebSocketStdlibAdapter (ClientWebSocket webSocket)
 
async Task CloseAsync ()
 Close the socket with an asynchronous operation.
 
async Task ConnectAsync (Uri uri, int timeout)
 Connect to the server with an asynchronous operation.
Parameters
uriThe URI of the server.
timeoutThe timeout for the connect attempt on the socket.

 
Task SendAsync (ArraySegment< byte > buffer, bool reliable=true, CancellationToken canceller=default)
 Send data to the server with an asynchronous operation.
Parameters
bufferThe buffer with the message to send.
reliableIf the message should be sent reliably (will be ignored by some protocols).
cancellerA cancellation token used to propagate when the operation should be canceled.

 
override string ToString ()
 

Properties

bool IsConnected [get]
 If the WebSocket is connected.
 
bool IsConnecting [get]
 If the WebSocket is connecting.
 
- Properties inherited from Nakama.ISocketAdapter

Events

Action Connected
 
Action Closed
 
Action< Exception > ReceivedError
 
Action< ArraySegment< byte > > Received
 
- Events inherited from Nakama.ISocketAdapter
Action Connected
 An event dispatched when the socket is connected.
 
Action Closed
 An event dispatched when the socket is disconnected.
 
Action< Exception > ReceivedError
 An event dispatched when the socket has an error when connected.
 
Action< ArraySegment< byte > > Received
 An event dispatched when the socket receives a message.
 

Detailed Description

An adapter which uses the WebSocket protocol with Nakama server.

Constructor & Destructor Documentation

◆ WebSocketStdlibAdapter() [1/2]

Nakama.WebSocketStdlibAdapter.WebSocketStdlibAdapter ( int  sendTimeoutSec = SendTimeoutSec,
int  maxMessageReadSize = MaxMessageReadSize 
)
inline

◆ WebSocketStdlibAdapter() [2/2]

Nakama.WebSocketStdlibAdapter.WebSocketStdlibAdapter ( ClientWebSocket  webSocket)
inline

Member Function Documentation

◆ CloseAsync()

async Task Nakama.WebSocketStdlibAdapter.CloseAsync ( )
inline

Close the socket with an asynchronous operation.

Implements Nakama.ISocketAdapter.

◆ ConnectAsync()

async Task Nakama.WebSocketStdlibAdapter.ConnectAsync ( Uri  uri,
int  timeout 
)
inline

Connect to the server with an asynchronous operation.

Parameters
uriThe URI of the server.
timeoutThe timeout for the connect attempt on the socket.

Implements Nakama.ISocketAdapter.

◆ SendAsync()

Task Nakama.WebSocketStdlibAdapter.SendAsync ( ArraySegment< byte >  buffer,
bool  reliable = true,
CancellationToken  canceller = default 
)
inline

Send data to the server with an asynchronous operation.

Parameters
bufferThe buffer with the message to send.
reliableIf the message should be sent reliably (will be ignored by some protocols).
cancellerA cancellation token used to propagate when the operation should be canceled.

Implements Nakama.ISocketAdapter.

◆ ToString()

override string Nakama.WebSocketStdlibAdapter.ToString ( )

Property Documentation

◆ IsConnected

bool Nakama.WebSocketStdlibAdapter.IsConnected
get

If the WebSocket is connected.

Implements Nakama.ISocketAdapter.

◆ IsConnecting

bool Nakama.WebSocketStdlibAdapter.IsConnecting
get

If the WebSocket is connecting.

Implements Nakama.ISocketAdapter.

Event Documentation

◆ Closed

Action Nakama.WebSocketStdlibAdapter.Closed

◆ Connected

Action Nakama.WebSocketStdlibAdapter.Connected

◆ Received

Action<ArraySegment<byte> > Nakama.WebSocketStdlibAdapter.Received

◆ ReceivedError

Action<Exception> Nakama.WebSocketStdlibAdapter.ReceivedError


The documentation for this class was generated from the following file: