예제 #1
0
        private static void SendRequestImpl(HTTPRequest request)
        {
            ConnectionBase conn = FindOrCreateFreeConnection(request);

            if (conn != null)
            {
                // found a free connection: put it in the ActiveConnection list(they will be checked periodically in the OnUpdate call)
                if (ActiveConnections.Find((c) => c == conn) == null)
                {
                    ActiveConnections.Add(conn);
                }

                FreeConnections.Remove(conn);

                request.State = HTTPRequestStates.Processing;

                request.Prepare();

                // then start process the request
                conn.Process(request);
            }
            else
            {
                // If no free connection found and creation prohibited, we will put back to the queue
                request.State = HTTPRequestStates.Queued;
                RequestQueue.Add(request);
            }
        }
예제 #2
0
        private static void SendRequestImpl(HTTPRequest request)
        {
            HTTPConnection conn = HTTPManager.FindOrCreateFreeConnection(request);

            if (conn != null)
            {
                if (HTTPManager.ActiveConnections.Find((HTTPConnection c) => c == conn) == null)
                {
                    HTTPManager.ActiveConnections.Add(conn);
                }
                HTTPManager.FreeConnections.Remove(conn);
                request.State = HTTPRequestStates.Processing;
                request.Prepare();
                conn.Process(request);
            }
            else
            {
                request.State = HTTPRequestStates.Queued;
                HTTPManager.RequestQueue.Add(request);
            }
        }
예제 #3
0
        private static void SendRequestImpl(HTTPRequest request)
        {
            ConnectionBase conn = FindOrCreateFreeConnection(request);

            if (conn != null)
            {
                // found a free connection: put it in the ActiveConnection list(they will be checked periodically in the OnUpdate call)
                if (ActiveConnections.Find((c) => c == conn) == null)
                    ActiveConnections.Add(conn);

                FreeConnections.Remove(conn);

                request.State = HTTPRequestStates.Processing;

                request.Prepare();

                // then start process the request
                conn.Process(request);
            }
            else
            {
                // If no free connection found and creation prohibited, we will put back to the queue
                request.State = HTTPRequestStates.Queued;
                RequestQueue.Add(request);
            }
        }