예제 #1
0
 /// <summary>
 /// 尝试发送回复数据
 /// </summary>
 /// <exception cref="SocketException"></exception>
 /// <exception cref="ArgumentNullException"></exception>
 /// <param name="response">回复内容</param>
 public bool TrySend(WebsocketResponse response)
 {
     try
     {
         this.Send(response);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #2
0
 /// <summary>
 /// 发送回复数据
 /// </summary>
 /// <exception cref="SocketException"></exception>
 /// <exception cref="ArgumentNullException"></exception>
 /// <param name="response">回复内容</param>
 public int Send(WebsocketResponse response)
 {
     return(this.session.Send(response.ToArraySegment(mask: false)));
 }
예제 #3
0
 /// <summary>
 /// 发送回复数据
 /// </summary>
 /// <exception cref="SocketException"></exception>
 /// <exception cref="ArgumentNullException"></exception>
 /// <param name="response">回复内容</param>
 public void Send(WebsocketResponse response)
 {
     this.session.Send(response.ToByteRange());
 }
예제 #4
0
 /// <summary>
 /// 发送回复数据
 /// </summary>
 /// <exception cref="SocketException"></exception>
 /// <exception cref="ArgumentNullException"></exception>   
 /// <param name="response">回复内容</param>
 public void Send(WebsocketResponse response)
 {
     this.session.Send(response.ToByteRange());
 }