Nakama .NET 3.1.1
.NET client for Nakama server written in C
Nakama.WebSocketAdapter Class Reference

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

Inheritance diagram for Nakama.WebSocketAdapter:
Nakama.ISocketAdapter

Public Member Functions

 WebSocketAdapter (int keepAliveIntervalSec=KeepAliveIntervalSec, int sendTimeoutSec=SendTimeoutSec)
 
 WebSocketAdapter (WebSocketClientOptions options, int sendTimeoutSec)
 
void Close ()
 Close the socket with an asynchronous operation. More...
 
async void Connect (Uri uri, int timeout)
 Connect to the server with an asynchronous operation. More...
 
void Dispose ()
 
async void Send (ArraySegment< byte > buffer, CancellationToken cancellationToken, bool reliable=true)
 Send data to the server with an asynchronous operation. More...
 
override string ToString ()
 

Properties

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

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. More...
 
Action Closed
 An event dispatched when the socket is disconnected. More...
 
Action< Exception > ReceivedError
 An event dispatched when the socket has an error when connected. More...
 
Action< ArraySegment< byte > > Received
 An event dispatched when the socket receives a message. More...
 

Detailed Description

An adapter which uses the WebSocket protocol with Nakama server.

Constructor & Destructor Documentation

◆ WebSocketAdapter() [1/2]

Nakama.WebSocketAdapter.WebSocketAdapter ( int  keepAliveIntervalSec = KeepAliveIntervalSec,
int  sendTimeoutSec = SendTimeoutSec 
)
inline

◆ WebSocketAdapter() [2/2]

Nakama.WebSocketAdapter.WebSocketAdapter ( WebSocketClientOptions  options,
int  sendTimeoutSec 
)
inline

Member Function Documentation

◆ Close()

void Nakama.WebSocketAdapter.Close ( )
inline

Close the socket with an asynchronous operation.

Implements Nakama.ISocketAdapter.

◆ Connect()

async void Nakama.WebSocketAdapter.Connect ( Uri  uri,
int  timeout 
)
inline

Connect to the server with an asynchronous operation.

Implements Nakama.ISocketAdapter.

◆ Dispose()

void Nakama.WebSocketAdapter.Dispose ( )
inline

◆ Send()

async void Nakama.WebSocketAdapter.Send ( ArraySegment< byte >  buffer,
CancellationToken  cancellationToken,
bool  reliable = true 
)
inline

Send data to the server with an asynchronous operation.

Implements Nakama.ISocketAdapter.

◆ ToString()

override string Nakama.WebSocketAdapter.ToString ( )
inline

Property Documentation

◆ IsConnected

bool Nakama.WebSocketAdapter.IsConnected
get

If the WebSocket is connected.

◆ IsConnecting

bool Nakama.WebSocketAdapter.IsConnecting
get

If the WebSocket is connecting.

Event Documentation

◆ Closed

Action Nakama.WebSocketAdapter.Closed

◆ Connected

Action Nakama.WebSocketAdapter.Connected

◆ Received

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

◆ ReceivedError

Action<Exception> Nakama.WebSocketAdapter.ReceivedError


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