An adapter which uses the WebSocket protocol with Nakama server.
More...
|
| | 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
-
| uri | The URI of the server. |
| timeout | The 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
-
| 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. |
|
| override string | ToString () |
|
| Action | Connected |
| Action | Closed |
| Action< Exception > | ReceivedError |
| Action< ArraySegment< byte > > | Received |
| 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 uses the WebSocket protocol with Nakama server.
◆ WebSocketStdlibAdapter() [1/2]
| Nakama.WebSocketStdlibAdapter.WebSocketStdlibAdapter |
( |
int | sendTimeoutSec = SendTimeoutSec, |
|
|
int | maxMessageReadSize = MaxMessageReadSize ) |
|
inline |
◆ WebSocketStdlibAdapter() [2/2]
| Nakama.WebSocketStdlibAdapter.WebSocketStdlibAdapter |
( |
ClientWebSocket | webSocket | ) |
|
|
inline |
◆ CloseAsync()
| async Task Nakama.WebSocketStdlibAdapter.CloseAsync |
( |
| ) |
|
|
inline |
◆ ConnectAsync()
| async Task Nakama.WebSocketStdlibAdapter.ConnectAsync |
( |
Uri | uri, |
|
|
int | timeout ) |
|
inline |
Connect to the server with an asynchronous operation.
- Parameters
-
| uri | The URI of the server. |
| timeout | The 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
-
| 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. |
Implements Nakama.ISocketAdapter.
◆ ToString()
| override string Nakama.WebSocketStdlibAdapter.ToString |
( |
| ) |
|
◆ IsConnected
| bool Nakama.WebSocketStdlibAdapter.IsConnected |
|
get |
◆ IsConnecting
| bool Nakama.WebSocketStdlibAdapter.IsConnecting |
|
get |
◆ 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: