コード例 #1
0
 public bool Send(string info)
 {
     if (!Connected)
     {
         return(false);
     }
     try
     {
         SockeClient.Send(PackageServerData(info));
     }
     catch (Exception ex)
     {
         Console.WriteLine("WebSocket.Send()" + ex.Message);
         return(false);
     }
     return(true);
 }
コード例 #2
0
 /// <summary>
 /// 建立握手连接
 /// </summary>
 /// <param name="data"></param>
 /// <param name="len"></param>
 public void HandShake(byte[] data, int len)
 {
     SockeClient.Send(PackageHandShakeData(data, len));
     Connected = true;
 }