• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetRequest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetRequest函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRequest函数的具体用法?C++ GetRequest怎么用?C++ GetRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetRequest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GetRequest

bool qEnvApache::SetReplyCode(int reply)
{
	if (!IsFlushed()) {
		GetRequest()->status = reply;
		return true;
	}
	return false;
}
开发者ID:BackupTheBerlios,项目名称:smx-svn,代码行数:8,代码来源:modsmx.cpp


示例17: iislua_req_get_url_args

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

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

    lua_createtable(L, 0, 0);

    if (ctx->GetRequest()->GetRawHttpRequest()->CookedUrl.pQueryString != NULL)
    {
        auto queryString = iislua_to_str(ctx->GetRequest()->GetRawHttpRequest()->CookedUrl.pQueryString);
    }

    return 1;
}
开发者ID:shibayan,项目名称:iislua,代码行数:18,代码来源:iislua_req.cpp


示例18: SetBuffer

_Must_inspect_result_
PVOID
FxRequestSystemBuffer::GetBuffer(
    VOID
    )
/*++

Routine Description:
    Returns the system buffer that has been cached away by the call to SetBuffer()

Arguments:
    None

Return Value:
    Valid memory or NULL on error

  --*/
{
    FxDevice* pDevice;
    FxIrp* irp = GetRequest()->GetFxIrp();
    WDF_DEVICE_IO_TYPE ioType;

    switch (irp->GetMajorFunction()) {
    case IRP_MJ_DEVICE_CONTROL:
    case IRP_MJ_INTERNAL_DEVICE_CONTROL:
        return m_Buffer;

    case IRP_MJ_READ:
    case IRP_MJ_WRITE:
        pDevice = FxDevice::GetFxDevice(irp->GetDeviceObject());
        ioType = pDevice->GetIoType(); 

        switch (ioType) {
        case WdfDeviceIoBuffered:
            return m_Buffer;

        case WdfDeviceIoDirect:
            //
            // FxRequest::GetMemoryObject has already called MmGetSystemAddressForMdlSafe
            // and returned success, so we know that we can safely call
            // MmGetSystemAddressForMdlSafe again to get a valid VA pointer.
            //
            return Mx::MxGetSystemAddressForMdlSafe(m_Mdl, NormalPagePriority);

        case WdfDeviceIoNeither:
            return m_Buffer;

        default:
            ASSERT(FALSE);
            return NULL;
        }

    default:
        ASSERT(FALSE);
        return NULL;
    }
}
开发者ID:Archer-sys,项目名称:Windows-Driver-Frameworks,代码行数:57,代码来源:fxrequestsystembufferkm.cpp


示例19: while

DWORD CBaseSplitterOutputPin::ThreadProc()
{
	m_hrDeliver = S_OK;
	m_fFlushing = m_fFlushed = false;
	m_eEndFlush.Set();

	while(1)
	{
		Sleep(1);

		DWORD cmd;
		if(CheckRequest(&cmd))
		{
			m_hThread = NULL;
			cmd = GetRequest();
			Reply(S_OK);
			ASSERT(cmd == CMD_EXIT);
			return 0;
		}

		int cnt = 0;
		do
		{
			CAutoPtr<Packet> p;

			{
				CAutoLock cAutoLock(&m_queue);
				if((cnt = m_queue.GetCount()) > 0)
					p = m_queue.Remove();
			}

			if(S_OK == m_hrDeliver && cnt > 0)
			{
				ASSERT(!m_fFlushing);

				m_fFlushed = false;

				// flushing can still start here, to release a blocked deliver call

				HRESULT hr = p 
					? DeliverPacket(p) 
					: DeliverEndOfStream();

				m_eEndFlush.Wait(); // .. so we have to wait until it is done

				if(hr != S_OK && !m_fFlushed) // and only report the error in m_hrDeliver if we didn't flush the stream
				{
					// CAutoLock cAutoLock(&m_csQueueLock);
					m_hrDeliver = hr;
					break;
				}
			}
		}
		while(--cnt > 0);
	}
}
开发者ID:banduladh,项目名称:meplayer,代码行数:56,代码来源:BaseSplitter.cpp


示例20: SetThreadName

DWORD CBDReaderFilter::ThreadProc()
{
  SetThreadName(-1, "BDReader_WORKER");

  m_bFlushing = false;
  m_eEndFlush.Set();

  for (DWORD cmd = (DWORD)-1; ; cmd = GetRequest())
  {
    if (cmd == CMD_EXIT)
    {
      m_hThread = NULL;
      Reply(S_OK);
      return 0;
    }

    SetThreadPriority(m_hThread, THREAD_PRIORITY_NORMAL);

    m_rtStart = m_rtNewStart;
    m_rtStop = m_rtNewStop;

    if (cmd == CMD_SEEK)
      Seek(m_rtStart);

    if (cmd != (DWORD)-1)
      Reply(S_OK);

    // Wait for the end of any flush
    m_eEndFlush.Wait();

    if (cmd == CMD_SEEK)
    {
      m_pVideoPin->DeliverNewSegment(m_rtStart, m_rtStop, m_dRate);
      m_pAudioPin->DeliverNewSegment(m_rtStart, m_rtStop, m_dRate);
      m_pSubtitlePin->DeliverNewSegment(m_rtStart, m_rtStop, m_dRate);

      m_eEndNewSegment.Set();
    }

    while (!CheckRequest(&cmd)) 
      Sleep(5); // TODO remove polling or maybe start to use the worker thread for pre-caching data

    // If we didnt exit by request, deliver end-of-stream
    if (!CheckRequest(&cmd)) 
    {
      m_pAudioPin->EndOfStream();
      m_pVideoPin->EndOfStream();
      m_pSubtitlePin->EndOfStream();
    }
  }
  ASSERT(0); // we should only exit via CMD_EXIT

  m_hThread = NULL;
  return 0;
}
开发者ID:BMOTech,项目名称:MediaPortal-1,代码行数:55,代码来源:BDReader.cpp



注:本文中的GetRequest函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetResID函数代码示例发布时间:2022-05-30
下一篇:
C++ GetReq函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap