當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetRequest函數代碼示例

本文整理匯總了C++中GetRequest函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetRequest函數的具體用法?C++ GetRequest怎麽用?C++ GetRequest使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetRequest函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AfxSocketInit

DWORD CAsyncUrlReader::ThreadProc()
{
    AfxSocketInit(nullptr);

    DWORD cmd = GetRequest();
    if (cmd != CMD_INIT) {
        Reply((DWORD)E_FAIL);
        return (DWORD) - 1;
    }

    try {
        CInternetSession is;
        CAutoPtr<CStdioFile> fin(is.OpenURL(m_url, 1, INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_CACHE_WRITE));

        TCHAR path[MAX_PATH], fn[MAX_PATH];
        CFile fout;
        if (GetTempPath(MAX_PATH, path) && GetTempFileName(path, _T("mpc_http"), 0, fn)
                && fout.Open(fn, modeCreate | modeWrite | shareDenyWrite | typeBinary)) {
            m_fn = fn;

            char buff[1024];
            int len = fin->Read(buff, sizeof(buff));
            if (len > 0) {
                fout.Write(buff, len);
            }

            Reply(S_OK);

            while (!CheckRequest(&cmd)) {
                int len2 = fin->Read(buff, sizeof(buff));
                if (len2 > 0) {
                    fout.Write(buff, len2);
                }
            }
        } else {
            Reply((DWORD)E_FAIL);
        }

        fin->Close(); // must close it because the destructor doesn't seem to do it and we will get an exception when "is" is destroying
    } catch (CInternetException* ie) {
        ie->Delete();
        Reply((DWORD)E_FAIL);
    }

    //

    cmd = GetRequest();
    ASSERT(cmd == CMD_EXIT);
    Reply(S_OK);

    //

    m_hThread = nullptr;

    return S_OK;
}
開發者ID:slavanap,項目名稱:ssifSource,代碼行數:56,代碼來源:AsyncReader.cpp

示例2: ap_table_add

bool qEnvApache::AppendHeader(const char *str, const char *val)
{
	if (!IsFlushed()) {
		ap_table_add(GetRequest()->headers_out, str, val);
		if (!stricmp(str,"set-cookie"))
			ap_table_add(GetRequest()->err_headers_out, str, val);
		return true;
	}
	return false;
}
開發者ID:BackupTheBerlios,項目名稱:smx-svn,代碼行數:10,代碼來源:modsmx.cpp

示例3: ap_table_set

bool qEnvApache::SetHeader(const char *str, const char *val)
{
	if (!IsFlushed()) {
		ap_table_set(GetRequest()->headers_out, str, val);
		if (!stricmp(str,"content-type")) {
			myReq->content_type = ap_pstrdup(myReq->pool, val);
		} else  if (!stricmp(str,"set-cookie"))
			ap_table_set(GetRequest()->err_headers_out, str, val);
		return true;
	}
	return false;
}
開發者ID:BackupTheBerlios,項目名稱:smx-svn,代碼行數:12,代碼來源:modsmx.cpp

示例4: main

/*
 * @brief	主程序
 */
int main(void)
{
	Request req;
	char weightBUf[32];
	char devCode[32];

  	SystemInit();
	ModulesInit();

	SelectChannel(GPRS_CHANNEL);
	GPRS_GetDevCode(devCode, sizeof(devCode));

	SelectChannel(BLUETOOTH_CHANNEL);
	while(GetRequest() != SYS_START){}	/* 等待接收SYS_START信號以開始工作 */
	SendResponse(SYS_START);

	BT_Println(devCode);

	while(1) {
		myWDGInit(30);	/* 設置定時器,值為30*2=60s=1min。超時會導致係統認為藍牙已斷開,從而進入alarm模式。 */

		req = GetRequest();	/* 獲取應用請求,並調用相應功能API */
		if(FALSE == TimeoutFlag) {
			switch(req) {
				case KEEP_ALIVE:
					SendResponse(KEEP_ALIVE);
					ResetWDGCounter();
					break;

				case GET_WEIGHT:
					SendResponse(GET_WEIGHT);
					GetWeight(weightBUf);
					BT_Println(weightBUf);
					ResetWDGCounter();
					break;

				case UNLOCK_DEVICE:
					SendResponse(UNLOCK_DEVICE);
					LOCK_Unlock();	/* 解鎖電子鎖 */
					ResetWDGCounter();
					break;

				default:
					BT_Println("Request invalid.");
			}
		}else {
			while(1) { ReportLocation(); }
		}

	}

	return 0;
}
開發者ID:gaunthan,項目名稱:SmartTrolleyCase,代碼行數:56,代碼來源:main.c

示例5: DiscardRequest

void HTTP::DiscardRequest(int requestHandle)
	{
	Request* request=GetRequest(requestHandle);

	if (request)
		{
		if (request->connection)
			{
			delete request->connection;
			}
		if (request->requestString)
			{
			Free(request->requestString);
			}
		if (request->resource)
			{
			delete request->resource;
			}
		BagIterator<Request*> it(requests_);
		if (it.Find(request))
			{
			requests_.Remove(it);
			}
		delete request;
		}

	}
開發者ID:RichardMarks,項目名稱:Pixie,代碼行數:27,代碼來源:HTTP.cpp

示例6: GetRequest

FileRequestAsync* AsyncHandler::RequestFile(const std::string& folder_name, const std::string& file_name) {
	std::string path = FileFinder::MakePath(folder_name, file_name);

	FileRequestAsync* request = GetRequest(path);

	if (request) {
		return request;
	}

	FileRequestAsync req(folder_name, file_name);
	RegisterRequest(path, req);

	//Output::Debug("Waiting for %s", path.c_str());

	return GetRequest(path);
}
開發者ID:glynnc,項目名稱:Player,代碼行數:16,代碼來源:async_handler.cpp

示例7: GetRequest

DWORD
CPullPin::ThreadProc(void)
{
    for (;;) {
	DWORD cmd = GetRequest();
	switch(cmd) {
	case TM_Exit:
	    Reply(S_OK);
	    return 0;

	case TM_Pause:
	    // we are paused already
	    Reply(S_OK);
	    break;

	case TM_Start:
	    Reply(S_OK);
	    Process();
	    break;
	}

	// at this point, there should be no outstanding requests on the
	// upstream filter.
	// We should force begin/endflush to ensure that this is true.
	// !!!Note that we may currently be inside a BeginFlush/EndFlush pair
	// on another thread, but the premature EndFlush will do no harm now
	// that we are idle.
	m_pReader->BeginFlush();
	CleanupCancelled();
	m_pReader->EndFlush();
    }
}
開發者ID:hiplayer,項目名稱:mpc_hc,代碼行數:32,代碼來源:pullpin.cpp

示例8: DebugLog

DWORD CWavPackDSSplitterInputPin::ThreadProc()
{
    Command com; 
    
    DebugLog("===> Entering CWavPackDSSplitterInputPin::ThreadProc... 0x%08X", GetCurrentThreadId());

    do 
    { 
        DebugLog("===> ThreadProc waiting command... 0x%08X", GetCurrentThreadId());
        com = (Command)GetRequest();
        switch (com) 
        { 
        case CMD_EXIT:
            DebugLog("===> ThreadProc CMD_EXIT 0x%08X", GetCurrentThreadId());
            Reply(NOERROR); 
            break; 
            
        case CMD_STOP: 
            DebugLog("===> ThreadProc CMD_STOP 0x%08X", GetCurrentThreadId());
            Reply(NOERROR); 
            break; 
            
        case CMD_RUN:
            DebugLog("===> ThreadProc CMD_RUN 0x%08X", GetCurrentThreadId());
            DebugLog("===> Entering DoProcessingLoop... 0x%08X", GetCurrentThreadId());
            DoProcessingLoop(); 
            DebugLog("<=== Leaving DoProcessingLoop 0x%08X", GetCurrentThreadId());
            break; 
        } 
    } while (com != CMD_EXIT);

    DebugLog("<=== Leaving CWavPackDSSplitterInputPin::ThreadProc 0x%08X", GetCurrentThreadId());
    
    return NOERROR; 
}
開發者ID:EQ4,項目名稱:WavPack-DirectShow,代碼行數:35,代碼來源:WavPackDSSplitter.cpp

示例9: iislua_req_get_headers

int iislua_req_get_headers(lua_State *L)
{
    auto ctx = iislua_get_http_ctx(L);

    if (ctx == NULL)
    {
        return luaL_error(L, "context is null");
    }

    auto headers = ctx->GetRequest()->GetRawHttpRequest()->Headers;

    lua_createtable(L, 0, headers.UnknownHeaderCount);

    for (USHORT i = 0; i < HttpHeaderRequestMaximum; i++)
    {
        if (headers.KnownHeaders[i].pRawValue != NULL)
        {
            lua_pushstring(L, iislua_util_get_http_req_header(i));
            lua_pushlstring(L, headers.KnownHeaders[i].pRawValue, headers.KnownHeaders[i].RawValueLength);
            lua_settable(L, -3);
        }
    }

    for (USHORT i = 0; i < headers.UnknownHeaderCount; i++)
    {
        lua_pushlstring(L, headers.pUnknownHeaders[i].pName, headers.pUnknownHeaders[i].NameLength);
        lua_pushlstring(L, headers.pUnknownHeaders[i].pRawValue, headers.pUnknownHeaders[i].RawValueLength);
        lua_settable(L, -3);
    }

    return 1;
}
開發者ID:shibayan,項目名稱:iislua,代碼行數:32,代碼來源:iislua_req.cpp

示例10: augeGetLoggerInstance

	void GetCountRequest::Info()
	{
		GLogger* pLogger = augeGetLoggerInstance();
		char str[AUGE_MSG_MAX];
		const char* value = GetRequest();
		pLogger->Debug("[Requet Parameters]");
		g_sprintf(str,"\t%s:%s", "Request", (value==NULL)?"":value);
		pLogger->Debug(str);
		
		value = GetVersion();
		g_sprintf(str,"\t%s:%s", "Version", (value==NULL)?"":value);
		pLogger->Debug(str);

		g_sprintf(str,"\t%s:%s", "Service", "wfs");
		pLogger->Debug(str);

		value = GetMimeType();
		g_sprintf(str,"\t%s:%s", "MimeType", (value==NULL)?"":value);
		pLogger->Debug(str);

		value = GetTypeName();
		g_sprintf(str,"\t%s:%s", "TypeName", (value==NULL)?"":value);
		pLogger->Debug(str);

	}
開發者ID:marsprj,項目名稱:Auge.GIS,代碼行數:25,代碼來源:GetCountRequest.cpp

示例11: GetCurrentThreadId

DWORD  CAVISplitter::ThreadProc()
{
	m_threadid = GetCurrentThreadId();
	while (1) 
	{
		DWORD cmd = GetRequest();
		switch (cmd)
		{
		case tm_exit:
            stopPinsProcessingThreads();
			Reply(S_OK);
            return 0;

		case tm_pause:
			// we are paused already
            stopPinsProcessingThreads();
			Reply(S_OK);
            break;

		case tm_start:
			startPinsProcessingThreads();
            Reply(S_OK);
            break;
		}

	}
	return 0;
}
開發者ID:SolveigMultimedia,項目名稱:smm_avi_splitter,代碼行數:28,代碼來源:avisplitter.cpp

示例12: augeGetLoggerInstance

	void GetFeatureRequest::Info()
	{
		GLogger* pLogger = augeGetLoggerInstance();
		char str[AUGE_MSG_MAX];
		const char* value = GetRequest();
		pLogger->Debug("[Requet Parameters]");
		g_sprintf(str,"\t%s:%s", "Request", (value==NULL)?"":value);
		pLogger->Debug(str);
		
		value = GetVersion();
		g_sprintf(str,"\t%s:%s", "Version", (value==NULL)?"":value);
		pLogger->Debug(str);

		g_sprintf(str,"\t%s:%s", "Service", "wfs");
		pLogger->Debug(str);

		value = GetMimeType();
		g_sprintf(str,"\t%s:%s", "MimeType", (value==NULL)?"":value);
		pLogger->Debug(str);

		value = GetTypeName();
		g_sprintf(str,"\t%s:%s", "TypeName", (value==NULL)?"":value);
		pLogger->Debug(str);

		value = GetOutputFormat();
		g_sprintf(str,"\t%s:%s", "OutputFormat", (value==NULL)?"":value);
		pLogger->Debug(str);

		g_sprintf(str,"\t%s:%d", "MaxFeatures", GetMaxFeatures());
		pLogger->Debug(str);

		g_sprintf(str,"\t%s:%d", "Offset", GetOffset());
		pLogger->Debug(str);
	}
開發者ID:marsprj,項目名稱:Auge.GIS,代碼行數:34,代碼來源:GetFeatureRequest.cpp

示例13: iislua_req_get_remote_addr

int iislua_req_get_remote_addr(lua_State *L)
{
    auto ctx = iislua_get_http_ctx(L);

    if (ctx == NULL)
    {
        return luaL_error(L, "context is null");
    }

    auto remoteAddr = ctx->GetRequest()->GetRemoteAddress();

    char ipAddress[INET6_ADDRSTRLEN];

    if (remoteAddr->sa_family == AF_INET)
    {
        inet_ntop(AF_INET, &reinterpret_cast<SOCKADDR_IN *>(remoteAddr)->sin_addr, ipAddress, sizeof(ipAddress));
    }
    else
    {
        inet_ntop(AF_INET6, &reinterpret_cast<SOCKADDR_IN6 *>(remoteAddr)->sin6_addr, ipAddress, sizeof(ipAddress));
    }

    lua_pushstring(L, ipAddress);

    return 1;
}
開發者ID:shibayan,項目名稱:iislua,代碼行數:26,代碼來源:iislua_req.cpp

示例14: while

void* WorkerThread::Entry()
{
	while( true )
	{
		// Did we get a request to terminate?
		if(TestDestroy())
			break;

		ThreadRequest *request = GetRequest();
		if( request )
		{
			// Call user's implementation for processing request
			ProcessRequest( request );

			wxThread::Sleep(10);  // Allow other threads to work as well
			delete request;
			request = NULL;
			continue; // to avoid the sleep
		}

		// Sleep for 1 seconds, and then try again
		wxThread::Sleep(200);
	}
	return NULL;
}
開發者ID:BackupTheBerlios,項目名稱:codelite-svn,代碼行數:25,代碼來源:worker_thread.cpp

示例15: while

//CAMThread Stuff
DWORD OggDemuxFilter::ThreadProc() 
{	
	while(true) 
    {
		DWORD locThreadCommand = GetRequest();
	
		switch(locThreadCommand) 
        {
			case THREAD_EXIT:
	
				Reply(S_OK);
                LOG(logDEBUG) << __FUNCTIONW__ << " THREAD IS EXITING";
				return S_OK;

			case THREAD_RUN:
	
				Reply(S_OK);
				DataProcessLoop();
                LOG(logDEBUG) << __FUNCTIONW__ << " Data Process Loop has returned";
				break;

           case THREAD_SEEK:

               m_oggBuffer.clearData();
               SetCurrentReaderPos(GetRequestedSeekPos());
               Reply(S_OK);

               DataProcessLoop();
               LOG(logDEBUG) << __FUNCTIONW__ << " Seek request";
               break;
		}
	}

	return S_OK;
}
開發者ID:John-He-928,項目名稱:krkrz,代碼行數:36,代碼來源:OggDemuxFilter.cpp


注:本文中的GetRequest函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。