Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
Loading...
Searching...
No Matches
Nakama.ISocketAdapter Interface Reference

An adapter which implements a socket with a protocol supported by Nakama. More...

Inheritance diagram for Nakama.ISocketAdapter:
Nakama.WebSocketAdapter Nakama.WebSocketStdlibAdapter

Public Member Functions

Task CloseAsync ()
 Close the socket with an asynchronous operation.
 
Task ConnectAsync (Uri uri, int timeout)
 Connect to the server with an asynchronous operation.
 
Task SendAsync (ArraySegment< byte > buffer, bool reliable=true, CancellationToken canceller=default)
 Send data to the server with an asynchronous operation.
 

Properties

bool IsConnected [get]
 If the socket is connected.
 
bool IsConnecting [get]
 If the socket is connecting.
 

Events

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 implements a socket with a protocol supported by Nakama.

Member Function Documentation

◆ CloseAsync()

Task Nakama.ISocketAdapter.CloseAsync ( )

Close the socket with an asynchronous operation.

Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.

◆ ConnectAsync()

Task Nakama.ISocketAdapter.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.

Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.

◆ SendAsync()

Task Nakama.ISocketAdapter.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.

Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.

Property Documentation

◆ IsConnected

bool Nakama.ISocketAdapter.IsConnected
get

If the socket is connected.

Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.

◆ IsConnecting

bool Nakama.ISocketAdapter.IsConnecting
get

If the socket is connecting.

Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.

Event Documentation

◆ Closed

Action Nakama.ISocketAdapter.Closed

An event dispatched when the socket is disconnected.

◆ Connected

Action Nakama.ISocketAdapter.Connected

An event dispatched when the socket is connected.

◆ Received

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

An event dispatched when the socket receives a message.

◆ ReceivedError

Action<Exception> Nakama.ISocketAdapter.ReceivedError

An event dispatched when the socket has an error when connected.


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