Beispiel #1
0
		//--------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------
		void HttpRequest::OnComplete(u32 in_resultCode, const std::string& in_data, u32 in_responseCode)
		{
			if(m_isRequestCancelled == false && m_completionDelegate)
			{
				m_completionDelegate(this, CSNetworking::HttpResponse((CSNetworking::HttpResponse::Result)in_resultCode, in_responseCode, in_data));
			}
		}
		//------------------------------------------------------------------
		//------------------------------------------------------------------
		void HttpRequest::Update()
		{
			//Check if the data has finished streaming and invoke the completion delegate on the main thread
			if(m_isPollingComplete == true)
			{
                m_isRequestComplete = true;

				if(m_isRequestCancelled == false)
				{
					m_completionDelegate(this, CSNetworking::HttpResponse(m_requestResult, m_responseCode, m_responseData));
				}
			}
		}
Beispiel #3
0
		//--------------------------------------------------------------------------------------
		//--------------------------------------------------------------------------------------
		void HttpRequest::OnFlushed(const std::string& in_data, u32 in_responseCode)
		{
			m_completionDelegate(this, CSNetworking::HttpResponse(CSNetworking::HttpResponse::Result::k_flushed, in_responseCode, in_data));
		}