当前位置: 首页>>代码示例>>C++>>正文


C++ Post函数代码示例

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


在下文中一共展示了Post函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TEST

TEST (RouterTester, BasicRouting) {
    
    HTTP::Router router;
    HTTP::Response response;
    router.Pipe ([&](const auto& data) { response = data; });
    
    MockEndPoint* endPoint1 = new MockEndPoint ("/test");
    MockEndPoint* endPoint2 = new MockEndPoint ("/not_test");
    
    router.AddEndPoint (std::shared_ptr <HTTP::AbstractEndPoint> (endPoint1));
    router.AddEndPoint (std::shared_ptr <HTTP::AbstractEndPoint> (endPoint2));
    
    EXPECT_CALL (*endPoint1, Get (::testing::_, ::testing::_)).Times (1);
    EXPECT_CALL (*endPoint1, Put (::testing::_, ::testing::_)).Times (0);
    EXPECT_CALL (*endPoint1, Post (::testing::_, ::testing::_)).Times (0);
    EXPECT_CALL (*endPoint1, Delete (::testing::_, ::testing::_)).Times (0);
 
    EXPECT_CALL (*endPoint2, Get (::testing::_, ::testing::_)).Times (0);
    EXPECT_CALL (*endPoint2, Put (::testing::_, ::testing::_)).Times (0);
    EXPECT_CALL (*endPoint2, Post (::testing::_, ::testing::_)).Times (0);
    EXPECT_CALL (*endPoint2, Delete (::testing::_, ::testing::_)).Times (0);
 
    const HTTP::Request request (HTTP::Method::GET, std::string ("/test"));
    router.Write (request);
    
    ASSERT_EQ (request.mVersion, response.mVersion);
    // endpoint should set status code
}
开发者ID:Eelco81,项目名称:server-test-project,代码行数:28,代码来源:HttpRouterTester.cpp

示例2: switch

void sBrowserTree::OnKey(sU32 key)
{
  switch(key&0x8001ffff)
  {
  case sKEY_DOWN:
    if(SelDir)
    {
      SerialSelect = 0;
      DirNext(Dir);
    }
    else
    {
      SelDir = Dir;
    }
    break;
  case sKEY_UP:
    if(SelDir)
    {
      SerialPrev = 0;
      DirPrev(Dir);
    }
    else
    {
      SelDir = Dir;
    }
    break;
  case sKEY_ENTER:
    if(SelDir)
    {
      DirSelect(SelDir);
    }
    break;
  case sKEY_LEFT:
    if(SelDir)
    {
      DirSelect(SelDir);
      SelDir->SetUserData(DIKey,0);
    }
    break;
  case sKEY_RIGHT:
    if(SelDir)
    {
      DirSelect(SelDir);
      SelDir->SetUserData(DIKey,1);
    }
    break;
  case sKEY_SPACE:
    Post(sBTCMD_SELDIR);
    break;
  case sKEY_TAB:
    Post(sBWCMD_FOCLIST);
    break;
  case sKEY_ESCAPE:
    Post(sBWCMD_EXIT);
    break;
  }
}
开发者ID:Ambrevar,项目名称:fr_public,代码行数:57,代码来源:appbrowser.cpp

示例3: Post

void Post(Btree BT)
{
     if(!isEmpty(BT))
    {

       Post(BT->lchild);
        Post(BT->rchild);
         printf("%c",BT->data);
    }
}
开发者ID:silent1993,项目名称:c-language,代码行数:10,代码来源:binary+tree.cpp

示例4: CreateCmdMatchResponseLoginFailed

bool MMatchServer::CheckOnLoginPre(const MUID& CommUID, int nCmdVersion, bool& outbFreeIP, string& strCountryCode3)
{
	MCommObject* pCommObj = (MCommObject*)m_CommRefCache.GetRef(CommUID);
	if (pCommObj == NULL) return false;

	// 프로토콜 버전 체크
	if (nCmdVersion != MCOMMAND_VERSION)
	{
		MCommand* pCmd = CreateCmdMatchResponseLoginFailed(CommUID, MERR_COMMAND_INVALID_VERSION);
		Post(pCmd);	
		return false;
	}

	// free login ip를 검사하기전에 debug서버와 debug ip를 검사한다.
	// 서버가 debug타입인지 검사.
	if( MGetServerConfig()->IsDebugServer() && MGetServerConfig()->IsDebugLoginIPList(pCommObj->GetIPString()) )
	{
		outbFreeIP = true;
		return true;
	}

	// 최대인원 체크
	bool bFreeLoginIP = false;
	if (MGetServerConfig()->CheckFreeLoginIPList(pCommObj->GetIPString()) == true) {
		bFreeLoginIP = true;
		outbFreeIP = true;
		return true;
	} else {
		outbFreeIP = false;

		if ((int)m_Objects.size() >= MGetServerConfig()->GetMaxUser())
		{
			MCommand* pCmd = CreateCmdMatchResponseLoginFailed(CommUID, MERR_CLIENT_FULL_PLAYERS);
			Post(pCmd);	
			return false;
		}
	}

	// 접속을 막아놓은 지역의 IP인가
	if( CheckIsValidIP(CommUID, pCommObj->GetIPString(), strCountryCode3, MGetServerConfig()->IsUseFilter()) )
		IncreaseNonBlockCount();
	else
	{
		IncreaseBlockCount();

		MCommand* pCmd = CreateCmdMatchResponseLoginFailed(CommUID, MERR_FAILED_BLOCK_IP);
		Post(pCmd);	
		return false;
	}

	return true;
}
开发者ID:kooksGame,项目名称:life-marvelous,代码行数:52,代码来源:MMatchServer_Login.cpp

示例5: PostHeader

//********************************************************************
// Name:  PostHeader
// Input:       1) return path
//                  2) Subject
//                  3) destination address
//                  4) DoMime flag
// Output:      Error code or Success
// Description:
// Author/Date:  jcar 20/9/96
// History:
//********************************************************************
int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
{

	// Print message header according to RFC 822
	// Return-path, Received, Date, From, Subject, Sender, To, cc

	time_t tNow = time(NULL);
	struct tm *tm = localtime(&tNow);
	int zoneh = abs(_timezone);
	int zonem, res;
	char *p;
	TLS_VARS;

	p = GLOBAL(Buffer);
	zoneh /= (60 * 60);
	zonem = (abs(_timezone) / 60) - (zoneh * 60);

	if(!xheaders || !strstr(xheaders, "Date:")){
		p += sprintf(p, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n",
					 days[tm->tm_wday],
					 tm->tm_mday,
					 months[tm->tm_mon],
					 tm->tm_year + 1900,
					 tm->tm_hour,
					 tm->tm_min,
					 tm->tm_sec,
					 (_timezone > 0) ? "+" : (_timezone < 0) ? "-" : "",
					 zoneh,
					 zonem);
	}

	if(!xheaders || !strstr(xheaders, "From:")){
		p += sprintf(p, "From: %s\r\n", RPath);
	}
	p += sprintf(p, "Subject: %s\r\n", Subject);
	if(!xheaders || !strstr(xheaders, "To:")){
		p += sprintf(p, "To: %s\r\n", mailTo);
	}
	if(xheaders){
		p += sprintf(p, "%s\r\n", xheaders);
	}

	if ((res = Post(GLOBAL(Buffer))) != SUCCESS)
		return (res);

	if ((res = Post("\r\n")) != SUCCESS)
		return (res);

	return (SUCCESS);
}
开发者ID:maiconschelter,项目名称:php-past,代码行数:61,代码来源:sendmail.c

示例6: LOGE

void CTcpSessionManager::OnConnectorStatus(ConnectorID connectorID, bool bConnected, CTcpSessionPtr session)
{
	auto config = m_mapConnectorConfig.find(connectorID);
	if (config == m_mapConnectorConfig.end())
	{
		LOGE("Unkwon Connector. Not Found ConnectorID=" << connectorID);
		return;
	}
	if (bConnected)
	{
		m_mapConnectorPtr[connectorID] = session;
		config->second.second.curReconnectCount = 0;
		config->second.second.totalConnectCount++;
		Post(std::bind(&CMessageDispatcher::DispatchOnConnectorEstablished, &CMessageDispatcher::getRef(), connectorID));
		return;
	}


	auto iter = m_mapConnectorPtr.find(connectorID);
	if (!bConnected && iter != m_mapConnectorPtr.end())
	{
		m_mapConnectorPtr.erase(connectorID);
		Post(std::bind(&CMessageDispatcher::DispatchOnConnectorDisconnect, &CMessageDispatcher::getRef(), connectorID));
	}

	if (!bConnected
		&& config->second.second.curReconnectCount > 0
		&& config->second.second.curReconnectCount < config->second.first.reconnectMaxCount)
	{
		config->second.second.curReconnectCount++;

		CTcpSocketPtr sockPtr(new zsummer::network::CTcpSocket());
		sockPtr->Initialize(m_summer);

		static const bool EnableFastConnect = false;//fast reconnect.  Be careful of remote server access denied.
		if (config->second.second.curReconnectCount == 1 && EnableFastConnect)
		{
			Post(std::bind(&CTcpSession::BindTcpConnectorPtr, session, sockPtr, config->second));
		}
		else
		{
			CreateTimer(config->second.first.reconnectInterval, std::bind(&CTcpSession::BindTcpConnectorPtr, session, sockPtr, config->second));
		}
	}
	else if (config->second.first.reconnectMaxCount > 0)
	{
		LOGE("Try Reconnect Failed. End Try. Traits=" << config->second.first);
	}
}
开发者ID:kkiluya,项目名称:zsummerX,代码行数:49,代码来源:FrameTcpSessionManager.cpp

示例7: MyRunnable

ECode CPagedViewIcon::ResetDrawableState()
{
    mLockDrawableState = FALSE;
    AutoPtr<MyRunnable> run = new MyRunnable(this);
    Boolean res;
    return Post(run, &res);
}
开发者ID:maerson,项目名称:CPP_Framework_Elastos5,代码行数:7,代码来源:CPagedViewIcon.cpp

示例8: GetSenderUIDBySocket

bool ZBirdDummyClient::OnSockRecv(SOCKET sock, char* pPacket, DWORD dwSize)
{
	if (m_pCommandBuilder==NULL) return false;
	// New Cmd Buffer ////////////////
	m_pCommandBuilder->SetUID(m_This, GetSenderUIDBySocket(sock));
	m_pCommandBuilder->Read((char*)pPacket, dwSize);

	LockRecv();
	while(MCommand* pCmd = m_pCommandBuilder->GetCommand()) 
	{
		Post(pCmd);
	}
	UnlockRecv();

	while(MPacketHeader* pNetCmd = m_pCommandBuilder->GetNetCommand()) 
	{
		if (pNetCmd->nMsg == MSGID_REPLYCONNECT) 
		{
			MReplyConnectMsg* pMsg = (MReplyConnectMsg*)pNetCmd;
			MUID HostUID, AllocUID;
			HostUID.High = pMsg->nHostHigh;
			HostUID.Low = pMsg->nHostLow;
			AllocUID.High = pMsg->nAllocHigh;
			AllocUID.Low = pMsg->nAllocLow;
			free(pNetCmd);

			LockRecv();
			OnConnected(sock, &HostUID, &AllocUID);
			UnlockRecv();
		}
	}

	return true;
}
开发者ID:MagistrAVSH,项目名称:node3d,代码行数:34,代码来源:ZBirdDummyClient.cpp

示例9: Post

void sTextControl::ScrollToCursor()
{
  sInt i,x,y,h,pos;
  sRect r;

  Post(CursorCmd);
  CursorWish = GetCursorX();

  h = sPainter->GetHeight(sGui->FixedFont);
  y = Client.y0+2;
  x = Client.x0+2;
  pos = 0;
  for(;;)
  {
    i = 0;
    while(Text[pos+i]!=0 && Text[pos+i]!='\n')
      i++;
    if(Cursor>=pos && Cursor<=pos+i)
    {
      r.x0 = x+sPainter->GetWidth(sGui->FixedFont,Text+pos,Cursor-pos);
      r.y0 = y;
      r.x1 = r.x0+1;
      r.y1 = y+h;
      ScrollTo(r,sGWS_SAFE);
      return;
    }
    y+=h;
    pos+=i;
    if(Text[pos]==0)
      break;
    if(Text[pos]=='\n')
      pos++;
  }
}
开发者ID:Ambrevar,项目名称:fr_public,代码行数:34,代码来源:apptext.cpp

示例10: Post

	void CIOServer::Fini(void)
	{
		if (!m_binit || m_status == status_null)
			return;

		Post(std::bind(&CIOServer::real_fini, this));
	}
开发者ID:mybestcool,项目名称:xhnet,代码行数:7,代码来源:impl_ioserver.cpp

示例11: CMessage

/**
 *
 * Method Name:  SDESReportSent()
 *
 *
 * Inputs:   IGetSrcDescription *piGetSrcDescription
 *                                 - Interface to the local Source Description
 *           IRTCPConnection    *piRTCPConnection
 *                                   - Interface to associated RTCP Connection
 *           IRTCPSession       *piRTCPSession
 *                                      - Interface to associated RTCP Session
 *
 * Outputs:  None
 *
 * Returns:  None
 *
 * Description: The SDESReportSent() event method shall inform the recipient
 *              of a newly transmitted SDES Report and shall include the
 *              IGetSrcDescription interface for accessing the contents of
 *              this transmitted SDES Report.
 *
 * Usage Notes:
 *
 */
void CRTCManager::SDESReportSent(IGetSrcDescription *piGetSrcDescription,
                                 IRTCPConnection    *piRTCPConnection,
                                 IRTCPSession       *piRTCPSession)
{

    // Create a message structure populated with the contents
    // of this event notification
    CMessage *poMessage = new CMessage(RTCP_SDES_SENT,
                                      (void *)piGetSrcDescription,
                                      (void *)piRTCPConnection,
                                      (void *)piRTCPSession);

    // Post the newly created event message to the RTC Manager's message queue
    // for processing by the Message Queue thread/task.
#ifdef TEST_PRINT
    OsSysLog::add(FAC_MP, PRI_DEBUG, "RTCP - CRTCManager::SDESReportSent new message 0x%08x \n", (int)poMessage);
#endif
    if(poMessage)
    {
        Post(poMessage);
#if defined(__pingtel_on_posix__)
        delete poMessage;
        poMessage = NULL;
#endif
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:50,代码来源:RTCManager.cpp

示例12: osPrintf

/**
 *
 * Method Name:  RemoteSSRCCollision()
 *
 *
 * Inputs:   IRTCPConnection    *piRTCPConnection
 *                                   - Interface to associated RTCP Connection
 *           IRTCPSession       *piRTCPSession
 *                                      - Interface to associated RTCP Session
 *
 * Outputs:  None
 *
 * Returns:  None
 *
 * Description: The RemoteSSRCCollision() event method shall inform the
 *              recipient of a collision between two remote participants.
 *
 * Usage Notes:
 *
 */
void CRTCManager::RemoteSSRCCollision(IRTCPConnection    *piRTCPConnection,
                                     IRTCPSession        *piRTCPSession)
{
#if RTCP_DEBUG /* [ */
    if(bPingtelDebug)
    {
         osPrintf("*** REMOTE SSRC COLLISION DETECTED ****\n");
         osPrintf("\t ON SESSION ==> %d\n", piRTCPSession->GetSessionID());
         osPrintf("\t WITH SSRC  ==> %d\n", piRTCPConnection->GetRemoteSSRC());
    }
#endif /* INCLUDE_RTCP ] */

    // Create a message structure populated with the contents
    // of this event notification
    CMessage *poMessage = new CMessage(REMOTE_SSRC_COLLISION,
                                      (void *)piRTCPConnection,
                                      (void *)piRTCPSession);

    // Post the newly created event message to the RTC Manager's message queue
    // for processing by the Message Queue thread/task.
#ifdef TEST_PRINT
    OsSysLog::add(FAC_MP, PRI_DEBUG, "RTCP - CRTCManager::RemoteSSRCCollision new message 0x%08x \n", (int)poMessage);
#endif
    if(poMessage)
    {
        Post(poMessage);
#if defined(__pingtel_on_posix__)
        delete poMessage;
        poMessage = NULL;
#endif
    }
}
开发者ID:mranga,项目名称:sipxecs,代码行数:52,代码来源:RTCManager.cpp

示例13: Post

void ReserveRetunrHomeController::reserveEquipment(char* result)
{
    std::string post_command = NativeLauncher::getNWAdress() + "/send_message?type=50";
    Post(post_command.c_str());

    return;
}
开发者ID:todo0508,项目名称:familia-20151024,代码行数:7,代码来源:ReserveReturnHome.cpp

示例14: check

 bool DepthFirstOrder::check()
 {
     // check that post(v) is consistent with post()
       std::size_t r = 0;
        for (std::size_t v : PostOrder()) {
            if (Post(v) != r) {
                std::cout<<"post(v) and post() inconsistent"<<std::endl;
                return false;
            }
            r++;
        }

        // check that pre(v) is consistent with pre()
        r = 0;
        for (std::size_t v : PreOrder()) {
            if (Pre(v) != r) {
                std::cout<<"post(v) and post() inconsistent"<<std::endl;
                 return false;
            }
            r++;
        }


        return true;
    }
开发者ID:vibhkat,项目名称:AlgorithmsAndDataStructuresAndGraph,代码行数:25,代码来源:DepthFirstOrder.cpp

示例15: read_posts

//--------------------------------------------------------------------------------------
//				read_posts()			       
//
//   Reads *Posts.json and generates a MICP container.
//   Returns the maximum value of a "date_gmt" node. 
//--------------------------------------------------------------------------------------
time_t read_posts(char const* fname, MICP* micp)
{
	myout << endl << clock()/CLOCKS_PER_SEC << "s\t read_posts: "  << fname << " ";
	time_t max=0, min=LONG_MAX;
	string line;
	int count = 0;
	ifstream infile(fname);		
	getline(infile, line, '\n');
	while (!infile.eof()) 
	{
		int size = line.size();						
		char* buf = new char[size];					
		line.copy(buf, size);						
		char* sz = buf;								

		time_t time = read_json_time(sz, "date_gmt"); 
		max = MAX(time, max);						
		int bid = read_json_str2int(sz, "blog");		
		int pid = read_json_str2int(sz, "post_id");	
		vector<unsigned> hash;
		read_json_hash(sz, "tags", &hash);
		read_json_hash(sz, "categories", &hash);
		micp->insert(Post(bid, pid, time, hash));
		if (++count % 20000 == 0)  myout << "." << flush; // progress bar
		getline(infile, line, '\n');
		delete[] buf;
	}
	infile.close();

	return max;
}
开发者ID:harixxy,项目名称:solutions,代码行数:37,代码来源:GigaOM.cpp


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