/// <summary> /// 得到客户端缓存(同步) /// </summary> public void GetCahceSyn(string userid, CallBackEvent callback) { try { TcpCli client = new TcpCli(ShareData.LocalIp, ShareData.LocalPort); MsgStruts msg = new MsgStruts(); msg.command = msgCommand.GetCache; msg.msgtype = msgType.SendText; msg.msgsendstate = msgSendState.single; msg.Data = _coder.GetEncodingBytes(userid); if (SystemConfig.GetCacheWaitSleep) {//socket缓冲区8192问题没有解决时使用延时加载形式去加载缓存数据 msg = client.SendAndBack(msg); callback(msg); } else { client.AsyncSendWithReceiverData(msg, callback); } } catch (Exception ex) { ex.ToString().ErrorLogger(); ShareData.Log.Info(ex); callback(null); } //return ClientCache.SetCache(msgb.Data); }