public HttpClient(string serverIp) { this.m_serverIp = serverIp; this.m_context = SynchronizationContext.Current; this.m_retry_wrapper = new HttpRetry(); ResumeRetryMessage(); m_is_retry_ui_show = false; m_sending_times = new Dictionary <string, long>(); m_atomic_sending_counter = 0; }
public BestHttpClient(string serverIp) { this.m_serverIp = serverIp; this.m_retry_wrapper = new HttpRetry(); ResumeRetryMessage(); m_is_retry_ui_show = false; HttpSendingCahce.Clear(); HttpPairCahce.Clear(); S_ATOMIC_COUNTER = 0; HTTPManager.MaxConnectionPerServer = 4; }
private void BornRetry(RequestMessageWrapper sendMessageWrapper) { Debug.Log("产生重新发送!!!睡眠"); Debug.Log(HttpRetry.GetCurrentTimeSecond()); Thread.Sleep(3000); Debug.Log("产生重新发送!!!睡眠结束"); Debug.Log(HttpRetry.GetCurrentTimeSecond()); Debug.Log("入列!!!"); this.m_retry_wrapper.Enqueue(sendMessageWrapper); this.m_context.Post(WorkQueueCallback, new SendMessageCallback() { MessageId = sendMessageWrapper.MessageId, Status = NetworkModule.NetworkStatus.RETRY_ONE_FINISHED }); }