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); }
/// <summary> /// 建立握手连接 /// </summary> /// <param name="data"></param> /// <param name="len"></param> public void HandShake(byte[] data, int len) { SockeClient.Send(PackageHandShakeData(data, len)); Connected = true; }