本文整理汇总了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);
}
示例2: mKQueue
WaitForEvent::WaitForEvent(int Timeout)
: mKQueue(::kqueue()),
mpTimeout(0)
{
if(mKQueue == -1)
{
THROW_EXCEPTION(CommonException, CouldNotCreateKQueue)
}
// Set the choosen timeout
SetTimeout(Timeout);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
}
示例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");
}
示例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);
}
}
}
示例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);
}
示例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;
}