[Modify] Add it

This commit is contained in:
sta 2021-11-01 20:46:19 +09:00
parent 15a99cef6a
commit 0816ad97c5

View File

@ -833,6 +833,27 @@ namespace WebSocketSharp.Server
{ {
} }
/// <summary>
/// Sends a ping to a client using the WebSocket connection.
/// </summary>
/// <returns>
/// <c>true</c> if the send has done with no error and a pong has been
/// received within a time; otherwise, <c>false</c>.
/// </returns>
/// <exception cref="InvalidOperationException">
/// The session has not started yet.
/// </exception>
protected bool Ping ()
{
if (_websocket == null) {
var msg = "The session has not started yet.";
throw new InvalidOperationException (msg);
}
return _websocket.Ping ();
}
/// <summary> /// <summary>
/// Sends the specified data to a client using the WebSocket connection. /// Sends the specified data to a client using the WebSocket connection.
/// </summary> /// </summary>