/// <summary> /// 映射值 /// </summary> /// <param name="Param"></param> public void ExecuteCallData(object Param) { JObject Obj = (Param as string).ToModel <JObject>(); var CallData = Obj["MiddleResult"].ToJson().ToModel <SocketResultDefault>(); CallEvent.Instance().Response = new Dictionary <string, object> { { "SocketJsonData", CallData.SocketJsonData.ToModel <object>() } }; }
/// <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()); } }