コード例 #1
0
 /// <summary>
 /// Sends data to the client with the text message type
 /// </summary>
 /// <param name="buffer">Data to send</param>
 /// <param name="endOfMessage">End of the message?</param>
 /// <returns>Task to send the data</returns>
 public Task SendText(ArraySegment <byte> buffer, bool endOfMessage)
 {
     return(mWebSocket.SendText(buffer, endOfMessage, mCancellToken.Token));
 }
コード例 #2
0
 /// <summary>
 /// Sends data to the client with the text message type
 /// </summary>
 /// <param name="buffer">Data to send</param>
 /// <param name="endOfMessage">End of the message?</param>
 /// <returns>Task to send the data</returns>
 public Task SendText(ArraySegment <byte> buffer, bool endOfMessage)
 {
     return(mWebSocket.SendText(buffer, endOfMessage, CancellationToken.None));
 }
コード例 #3
0
 /// <inheritdoc />
 public void Open() => WebSocket.SendText("Now open! Enter some C#!");
コード例 #4
0
 /// <summary>
 /// This method is called when the WebSocket is opened towards this Chatbot instance. A perfect
 /// time to send a welcome message.
 /// </summary>
 public void Open() => WebSocket.SendText(
     "> Hi, I'm a chatbot! Type anything, and I'll try my best to answer. I like to tell jokes... " +
     "(type QUIT to return to the shell)"
     );