/// <summary> /// 重新连接通信中心 /// </summary> /// <param name="Action"></param> public static void ReOpenInternalSocket(Action <ProxyBasic> Action) { ProxyBasic Client = new ProxyBasic(); Action(Client); if (Call.SocketClient.IsConnected) { Call.SocketClient.DisConnect(); } CallEvent.Instance().Changed += new CallEvent.ResultEventHandler(CallEventAction.Instance().OnResponse); Client.InitInternalSocket(Client.SockInfoIP, Client.SockInfoPort, DependencyExecute.Instance.FindLibrary()); }
/// <summary> /// 初始化通信中心Socket /// </summary> /// <param name="Action"></param> /// <param name="UseServer"></param> public static void InitInternalSocket(Action <ProxyBasic> Action, bool UseServer = false) { ProxyBasic Client = new ProxyBasic(); Action(Client); SocketConstConfig.ClientPort = Client.ClientPort; if (UseServer) { CallEvent.Instance().Changed += new CallEvent.ResultEventHandler(CallEventAction.Instance().OnResponse); Client.InitInternalSocket(Client.SockInfoIP, Client.SockInfoPort, DependencyExecute.Instance.FindLibrary()); } }