An adapter which uses the WebSocket protocol with Nakama server.
More...
|
| WebSocketAdapter (int keepAliveIntervalSec=KeepAliveIntervalSec, int sendTimeoutSec=SendTimeoutSec, int maxMessageReadSize=MaxMessageReadSize, ILogger logger=null) |
|
| WebSocketAdapter (WebSocketClientOptions options, int sendTimeoutSec, int maxMessageReadSize, ILogger logger) |
|
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.
◆ WebSocketAdapter() [1/2]
Nakama.WebSocketAdapter.WebSocketAdapter |
( |
int |
keepAliveIntervalSec = KeepAliveIntervalSec , |
|
|
int |
sendTimeoutSec = SendTimeoutSec , |
|
|
int |
maxMessageReadSize = MaxMessageReadSize , |
|
|
ILogger |
logger = null |
|
) |
| |
|
inline |
◆ WebSocketAdapter() [2/2]
◆ CloseAsync()
async Task Nakama.WebSocketAdapter.CloseAsync |
( |
| ) |
|
|
inline |
◆ ConnectAsync()
async Task Nakama.WebSocketAdapter.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.WebSocketAdapter.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.WebSocketAdapter.ToString |
( |
| ) |
|
◆ IsConnected
bool Nakama.WebSocketAdapter.IsConnected |
|
get |
◆ IsConnecting
bool Nakama.WebSocketAdapter.IsConnecting |
|
get |
◆ 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: