Nakama .NET 3.1.1
.NET client for Nakama server written in C
Nakama.ISocketAdapter Interface Reference

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

Inheritance diagram for Nakama.ISocketAdapter:
Nakama.WebSocketAdapter

Public Member Functions

void Close ()
 Close the socket with an asynchronous operation. More...
 
void Connect (Uri uri, int timeout)
 Connect to the server with an asynchronous operation. More...
 
void Send (ArraySegment< byte > buffer, CancellationToken cancellationToken, bool reliable=true)
 Send data to the server with an asynchronous operation. More...
 

Properties

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

Events

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

Member Function Documentation

◆ Close()

void Nakama.ISocketAdapter.Close ( )

Close the socket with an asynchronous operation.

Implemented in Nakama.WebSocketAdapter.

◆ Connect()

void Nakama.ISocketAdapter.Connect ( 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.

◆ Send()

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

Send data to the server with an asynchronous operation.

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

Implemented in Nakama.WebSocketAdapter.

Property Documentation

◆ IsConnected

bool Nakama.ISocketAdapter.IsConnected
get

If the socket is connected.

◆ IsConnecting

bool Nakama.ISocketAdapter.IsConnecting
get

If the socket is connecting.

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: