public void SetErrorRecorder(common.ErrorRecorder recorder) { lock (interLocker) { errorRecorder = recorder; } }
/* * Customized Init. */ public static void Init(Config config) { if (inited) { return; } lock (interLocker) { if (inited) { return; } if (config == null) { config = new Config(); } //--------------------- stopped = false; forbiddenRegisterConnection = false; connectingConnections = new Dictionary <TCPConnection, long>(); allConnections = new HashSet <TCPConnection>(); originDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); globalConnectTimeoutSeconds = config.globalConnectTimeoutSeconds; globalQuestTimeoutSeconds = config.globalQuestTimeoutSeconds; maxPayloadSize = config.maxPayloadSize; errorRecorder = config.errorRecorder; taskPool = new common.TaskThreadPool(config.taskThreadPoolConfig.initThreadCount, config.taskThreadPoolConfig.perfectThreadCount, config.taskThreadPoolConfig.maxThreadCount, config.taskThreadPoolConfig.maxQueueLengthLimitation, config.taskThreadPoolConfig.tempLatencySeconds, #if UNITY_2017_1_OR_NEWER false #else true #endif ); taskPool.SetErrorRecorder(config.errorRecorder); routineThread = new Thread(RoutineFunc) { Name = "FPNN.ClientEngine.RoutineThread", IsBackground = true }; routineThread.Start(); //--------------------- PlatformInit(); inited = true; } }
public RTMClient(string endpoint, long projectId, long uid, RTMQuestProcessor serverPushProcessor, bool autoRelogin = true) { interLocker = new object(); this.projectId = projectId; this.uid = uid; status = ClientStatus.Closed; requireClose = false; syncConnectingEvent = new ManualResetEvent(false); ConnectTimeout = 0; QuestTimeout = 0; RTMMasterProcessor processorCurrent = new RTMMasterProcessor(); processorCurrent.SetProcessor(serverPushProcessor); processor = processorCurrent; errorRecorder = RTMConfig.errorRecorder; if (errorRecorder != null) { processor.SetErrorRecorder(errorRecorder); } BuildRtmGateClient(endpoint); if (autoRelogin) { autoReloginInfo = new AutoReloginInfo(); regressiveStrategy = RTMConfig.globalRegressiveStrategy; } }
internal static void Config(RTMConfig config) { lostConnectionAfterLastPingInSeconds = config.maxPingInterval; globalConnectTimeoutSeconds = config.globalConnectTimeout; globalQuestTimeoutSeconds = config.globalQuestTimeout; fileGateClientHoldingSeconds = config.fileClientHoldingSeconds; errorRecorder = config.defaultErrorRecorder; }
internal static void Config(RTMConfig config) { lostConnectionAfterLastPingInSeconds = config.maxPingInterval; globalConnectTimeoutSeconds = config.globalConnectTimeout; globalQuestTimeoutSeconds = config.globalQuestTimeout; fileGateClientHoldingSeconds = config.fileClientHoldingSeconds; errorRecorder = config.defaultErrorRecorder; triggerCallbackIfAsyncMethodReturnFalse = config.forceTriggerCallbackWhenAsyncMethodReturnFalse; globalRegressiveStrategy = config.regressiveStrategy; }
//----------------[ Constructor ]-----------------------// public TCPClient(string host, int port, bool autoConnect = true) { interLocker = new object(); dnsEndpoint = new DnsEndPoint(host, port); ConnectTimeout = 0; QuestTimeout = 0; AutoConnect = autoConnect; status = ClientStatus.Closed; syncConnectingEvent = new ManualResetEvent(false); errorRecorder = ClientEngine.errorRecorder; }
public RTMClient(string endpoint, long pid, long uid, IRTMQuestProcessor serverPushProcessor) { interLocker = new object(); this.pid = pid; this.uid = uid; status = ClientStatus.Closed; requireClose = false; syncConnectingEvent = new ManualResetEvent(false); ConnectTimeout = 0; QuestTimeout = 0; processor = new RTMQuestProcessor(); processor.SetProcessor(serverPushProcessor); dispatch = TCPClient.Create(endpoint, true); errorRecorder = RTMConfig.errorRecorder; if (errorRecorder != null) { processor.SetErrorRecorder(errorRecorder); dispatch.SetErrorRecorder(errorRecorder); } }
public void SetErrorRecorder(common.ErrorRecorder er) { errorRecorder = er; }