/// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="code"></param>
        /// <param name="bs"></param>
        /// <returns></returns>
        public async Task Send(short code, byte[] bs)
        {
            List <byte> list = new List <byte>();

            list.AddRange(BitConverter.GetBytes(code));
            list.AddRange(bs);
            await ServerCommunicationInitialize.GetInitialize().Send(list.ToArray());
        }
 public static ServerCommunicationInitialize GetInitialize()
 {
     if (initialize == null)
     {
         lock (lockObj)
         {
             if (initialize == null)
             {
                 initialize = new ServerCommunicationInitialize();
             }
         }
     }
     return(initialize);
 }
Ejemplo n.º 3
0
 public async Task OnServerDisconnected(AsyncTcpClient client)
 {
     ServerCommunicationRealize.GetInitialize().OnServerDisconnected();
     ServerCommunicationInitialize.GetInitialize().RestConn();
 }