/// <summary> /// 初始化数据访问组件 /// </summary> public void Init() { if (netEP != null && (netEP.IpAddress != ClientConfig.ServerIP || netEP.TcpPort != ClientConfig.ServerPort)) { if (dataClient != null && dataClient.CommunicationState == Net.Communication.CommunicationStates.Connected) { dataClient.Disconnect(); } } netEP = new CJiaEndPoint(ClientConfig.ServerIP, ClientConfig.ServerPort); dataClient = CJiaClientBuilder.CreateClientApplication <CJia.Net.Service.IDataAdapter>(netEP); dataClient.Timeout = 6000 * 10; //三分钟超时 dataClient.AllowAutoPing = false; dataClient.PingInterval = 30000; //30秒 dataClient.Connect(); dataClient.ServiceProxy.Init(ClientCode, DbName); }