Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
|
An adapter which implements a socket with a protocol supported by Nakama. More...
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. | |
An adapter which implements a socket with a protocol supported by Nakama.
Task Nakama.ISocketAdapter.CloseAsync | ( | ) |
Close the socket with an asynchronous operation.
Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.
Task Nakama.ISocketAdapter.ConnectAsync | ( | Uri | uri, |
int | timeout | ||
) |
Connect to the server with an asynchronous operation.
uri | The URI of the server. |
timeout | The timeout for the connect attempt on the socket. |
Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.
Task Nakama.ISocketAdapter.SendAsync | ( | ArraySegment< byte > | buffer, |
bool | reliable = true , |
||
CancellationToken | canceller = default |
||
) |
Send data to the server with an asynchronous operation.
buffer | The buffer with the message to send. |
reliable | If the message should be sent reliably (will be ignored by some protocols). |
canceller | A cancellation token used to propagate when the operation should be canceled. |
Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.
|
get |
If the socket is connected.
Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.
|
get |
If the socket is connecting.
Implemented in Nakama.WebSocketAdapter, and Nakama.WebSocketStdlibAdapter.
Action Nakama.ISocketAdapter.Closed |
An event dispatched when the socket is disconnected.
Action Nakama.ISocketAdapter.Connected |
An event dispatched when the socket is connected.
Action<ArraySegment<byte> > Nakama.ISocketAdapter.Received |
An event dispatched when the socket receives a message.
Action<Exception> Nakama.ISocketAdapter.ReceivedError |
An event dispatched when the socket has an error when connected.