Ping Pong Manager used to facilitate ping pong WebSocket messages.
More...
|
| PingPongManager (Guid guid, WebSocket webSocket, TimeSpan keepAliveInterval, CancellationToken cancellationToken) |
| Initialises a new instance of the PingPongManager to facilitate ping pong WebSocket messages. If you are manually creating an instance of this class then it is advisable to set keepAliveInterval to TimeSpan.Zero when you create the WebSocket instance (using a factory) otherwise you may be automatically be sending duplicate Ping messages (see keepAliveInterval below)
|
|
async Task | SendPing (ArraySegment< byte > payload, CancellationToken cancellation) |
| Sends a ping frame.
|
|
Ping Pong Manager used to facilitate ping pong WebSocket messages.
◆ PingPongManager()
Nakama.Ninja.WebSockets.PingPongManager.PingPongManager |
( |
Guid |
guid, |
|
|
WebSocket |
webSocket, |
|
|
TimeSpan |
keepAliveInterval, |
|
|
CancellationToken |
cancellationToken |
|
) |
| |
|
inline |
Initialises a new instance of the PingPongManager to facilitate ping pong WebSocket messages. If you are manually creating an instance of this class then it is advisable to set keepAliveInterval to TimeSpan.Zero when you create the WebSocket instance (using a factory) otherwise you may be automatically be sending duplicate Ping messages (see keepAliveInterval below)
- Parameters
-
webSocket | The web socket used to listen to ping messages and send pong messages |
keepAliveInterval | The time between automatically sending ping messages. Set this to TimeSpan.Zero if you with to manually control sending ping messages. |
cancellationToken | The token used to cancel a pending ping send AND the automatic sending of ping messages if keepAliveInterval is positive |
◆ OnPong()
virtual void Nakama.Ninja.WebSockets.PingPongManager.OnPong |
( |
PongEventArgs |
e | ) |
|
|
inlineprotectedvirtual |
◆ SendPing()
async Task Nakama.Ninja.WebSockets.PingPongManager.SendPing |
( |
ArraySegment< byte > |
payload, |
|
|
CancellationToken |
cancellation |
|
) |
| |
|
inline |
◆ Pong
EventHandler<PongEventArgs> Nakama.Ninja.WebSockets.PingPongManager.Pong |
Raised when a Pong frame is received.
The documentation for this class was generated from the following file: