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


C++ SetTimeout函数代码示例

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


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

示例1: locker

void SslTcpClient::OnTimeout()
{
	OSMutexLocker locker(&fMutexList);
	SetTimeout(kTimeKeepAlive*1000);
	SetConnectStatus(kOffline);
	if(fTcpSocket != NULL)
	{
		delete fTcpSocket;
	}
	fTcpSocket = new SslTcpClientSocket(Socket::kNonBlockingSocketType);
	SetClientSocket(fTcpSocket);
}
开发者ID:wutao6362077,项目名称:pushserver,代码行数:12,代码来源:SslTcpClient.cpp

示例2: mKQueue

WaitForEvent::WaitForEvent(int Timeout)
	: mKQueue(::kqueue()),
	  mpTimeout(0)
{
	if(mKQueue == -1)
	{
		THROW_EXCEPTION(CommonException, CouldNotCreateKQueue)
	}

	// Set the choosen timeout
	SetTimeout(Timeout);
}
开发者ID:boxbackup,项目名称:boxbackup,代码行数:12,代码来源:WaitForEvent.cpp

示例3: InvalidateStatusIcons

void C4StartupNetListEntry::SetError(const char *szErrorText, TimeoutType eTimeout)
{
	// set error message
	fError = true;
	sInfoText[1].Copy(szErrorText);
	for (int i=2; i<InfoLabelCount; ++i) sInfoText[i].Clear();
	InvalidateStatusIcons();
	UpdateSmallState(); UpdateText();
	pIcon->SetIcon(C4GUI::Ico_Close);
	pIcon->SetAnimated(false, 0);
	pIcon->SetBounds(rctIconSmall);
	SetTimeout(eTimeout);
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:13,代码来源:C4StartupNetDlg.cpp

示例4: m_TaskManager

/*----------------------------------------------------------------------
|   PLT_EventSubscriber::PLT_EventSubscriber
+---------------------------------------------------------------------*/
PLT_EventSubscriber::PLT_EventSubscriber(PLT_TaskManager* task_manager, 
                                         PLT_Service*     service,
                                         const char*      sid,
                                         NPT_Timeout      timeout_secs /* = -1 */) : 
    m_TaskManager(task_manager), 
    m_Service(service), 
    m_EventKey(0),
    m_SubscriberTask(NULL),
    m_SID(sid)
{
    NPT_LOG_FINE_1("Creating new subscriber (%s)", m_SID.GetChars());
    SetTimeout(timeout_secs);
}
开发者ID:1c0n,项目名称:xbmc,代码行数:16,代码来源:PltEvent.cpp

示例5: MS_TRACE

	inline
	void DtlsTransport::onTimer(Timer* timer)
	{
		MS_TRACE();

		DTLSv1_handle_timeout(this->ssl);

		// If required, send DTLS data.
		SendPendingOutgoingDtlsData();

		// Set the DTLS timer again.
		SetTimeout();
	}
开发者ID:kurokky,项目名称:mediasoup,代码行数:13,代码来源:DtlsTransport.cpp

示例6: CTFATestCase

// -----------------------------------------------------------------------------
// CTFTestCaseRepeater::CTFTestCaseRepeater
// -----------------------------------------------------------------------------
EXPORT_C CTFTestCaseRepeater::CTFTestCaseRepeater( TInt aId, const TDesC& aName, CTFATestSuite* aSuite, TInt aRepeatCount, TBool aRandomRepeat )
: CTFATestCase( aId, aName )
, iSuite( aSuite )
, iRepeatCount( aRepeatCount )
, iRandomRepeat( aRandomRepeat )
    {
    if ( aSuite != NULL )
        {
        if ( iRandomRepeat )
            {
            SetTimeout( aRepeatCount * aSuite->Count() * KTFDefaultTimeout );
            }
        else
            {
            SetTimeout( aRepeatCount * aSuite->Count() * KTFLoopCount * KTFDefaultTimeout );
            }
        }
    else
        {
        TRACE_ASSERT_ALWAYS;
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:25,代码来源:tftestcaserepeater.cpp

示例7: SetMode

//错误0:检查不到wifi芯片  错误1:建立服务器失败
u8 esp8266::ConnectNetwork_server(short port)//作为服务器
{
	if(!kick() )
		return 0; //检查不到wifi芯片
	SetMode(2);
	restart();
	tskmgr.DelayS(3);
	SetMUX(false);
	if(!CreateServerMode(port))
		return 1;
	SetTimeout(0);
	return 0xff;
}
开发者ID:lissettecarlr,项目名称:environmental-monitoring,代码行数:14,代码来源:ESP8266.cpp

示例8: Requires

AutonomousMove::AutonomousMove(float velocity, float time) {
	// Use requires() here to declare subsystem dependencies
	// eg. requires(chassis);
	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
	Requires(Robot::driveTrain);

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
	m_velocity = velocity;
	m_time = time;
	m_distance = 0;
	SetTimeout(time);
	isDistanceMove = false;
}
开发者ID:AGHSEagleRobotics,项目名称:frc1388-2015-sandbox,代码行数:13,代码来源:AutonomousMove.cpp

示例9: bufferevent_socket_new

 void CTcpHandler::TcpAdd(CCommand *pCmd)
 {
     CTcpAddCommand *pConnectCmd = dynamic_cast<CTcpAddCommand *>(pCmd);
     CEventThread *pThread = dynamic_cast<CEventThread *>(GetThread()); 
     m_pBufevt = bufferevent_socket_new(pThread->GetEventBase(), 
             pConnectCmd->m_iFd, BEV_OPT_THREADSAFE);
     bufferevent_setcb(m_pBufevt, CNetThread::OnStaticRead, CNetThread::OnStaticWrite, CNetThread::OnStaticError, this);
     bufferevent_enable(m_pBufevt, EV_READ|EV_PERSIST|EV_ET);		
     bufferevent_setwatermark(m_pBufevt, EV_READ, 
                               OnRead(NULL, 0), 0);
     OnConnect();
     //告诉listen线程
     SetTimeout();
 }
开发者ID:EastQ,项目名称:libnsq,代码行数:14,代码来源:tcp_handler.cpp

示例10: CZNCSock

CIncomingConnection::CIncomingConnection(const CString& sHostname,
                                         unsigned short uPort,
                                         CListener::EAcceptType eAcceptType,
                                         const CString& sURIPrefix)
    : CZNCSock(sHostname, uPort),
      m_eAcceptType(eAcceptType),
      m_sURIPrefix(sURIPrefix) {
    // The socket will time out in 120 secs, no matter what.
    // This has to be fixed up later, if desired.
    SetTimeout(120, 0);

    SetEncoding("UTF-8");
    EnableReadLine();
}
开发者ID:Adam-,项目名称:znc,代码行数:14,代码来源:Listener.cpp

示例11: OnTimeout

 void OnTimeout() {
   SetTimeout(5);
   if (!m_state)
   {
     m_state = 1;
   }
   else
   {
     ConnectorSocket *s = new ConnectorSocket(Handler());
     s -> Open(gHost, gPort);
     s -> SetDeleteByHandler();
     Handler().Add(s);
   }
 }
开发者ID:J0nath4n,项目名称:mxoemu,代码行数:14,代码来源:stressclient.cpp

示例12: printf

// Called just before this Command runs the first time
void Autonomous_Simple::Initialize() {
	printf("Autonomous_Simple Initialize Start\n");
	Robot::driveTrain->Set_VoltageMode();
	Robot::driveTrain->Zero_DriveEncoders();
	first = false;
	hasMoved = false;
	SetTimeout(TimeOut);
	targetpulses = dist * Robot::driveTrain->Get_PulsesPerInch();
	startingPoint = Robot::driveTrain->Get_CurrentPosition();

	printf("Autonomous_Simple TimeOut = %f MaxThrottle = %f Throttle_Ramp = %f dist = %f\n",TimeOut,MaxThrottle, Throttle_Ramp,dist);
	printf("Autonomous_Simple targetpulses = %f startingPoint = %f\n",targetpulses,startingPoint);
	printf("Autonomous_Simple Initialize Complete\n");
}
开发者ID:4329,项目名称:2016_Dev,代码行数:15,代码来源:Autonomous_Simple.cpp

示例13: SetAnimationMode

void
AnimationAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("AnimationAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("animationMode")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetAnimationMode(AnimationMode(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            AnimationMode value;
            if(AnimationMode_FromString(node->AsString(), value))
                SetAnimationMode(value);
        }
    }
    if((node = searchNode->GetNode("pipelineCachingMode")) != 0)
        SetPipelineCachingMode(node->AsBool());
    if((node = searchNode->GetNode("frameIncrement")) != 0)
        SetFrameIncrement(node->AsInt());
    if((node = searchNode->GetNode("timeout")) != 0)
        SetTimeout(node->AsInt());
    if((node = searchNode->GetNode("playbackMode")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetPlaybackMode(PlaybackMode(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            PlaybackMode value;
            if(PlaybackMode_FromString(node->AsString(), value))
                SetPlaybackMode(value);
        }
    }
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:50,代码来源:AnimationAttributes.C

示例14: BMenuItem

ModelMenuItem::ModelMenuItem(const Model* model, BMenu* menu, bool drawText,
	bool extraPad)
	:
	BMenuItem(menu),
	fModel(*model),
	fHeightDelta(0),
	fDrawText(drawText),
	fExtraPad(extraPad)
{
	ThrowOnInitCheckError(&fModel);
	// ModelMenuItem is used in synchronously invoked menus, make sure
	// we invoke with a timeout
	SetTimeout(kSynchMenuInvokeTimeout);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:14,代码来源:IconMenuItem.cpp

示例15: SetTimeout

BOOLEAN NTTIMER::Satisfy( void )
{
	// FIXME: user correct time values
	if (ApcRoutine)
		Thread->QueueApcThread( ApcRoutine, ApcContext, 0, 0 );

	// restart the timer
	if (Interval)
	{
		LARGE_INTEGER when;
		when.QuadPart = Interval * -10000LL;
		SetTimeout( &when );
	}
	return TRUE;
}
开发者ID:bragin,项目名称:ring3k,代码行数:15,代码来源:timer.cpp


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