本文整理汇总了C++中Timestamp::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::update方法的具体用法?C++ Timestamp::update怎么用?C++ Timestamp::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testNamedEvent
void NamedEventTest::testNamedEvent()
{
Thread thr1;
TestEvent te;
thr1.start(te);
Timestamp now;
Thread::sleep(2000);
testEvent.set();
thr1.join();
assert (te.timestamp() > now);
Thread thr2;
thr2.start(te);
now.update();
Thread::sleep(2000);
testEvent.set();
thr2.join();
assert (te.timestamp() > now);
}
示例2: run
void RTMFPServerEdge::run() {
_serverSocket.connect(_serverAddress);
sockets.add(_serverSocket,*this);
_serverConnection.setEndPoint(_serverSocket,_serverAddress);
NOTE("Wait RTMFP server %s successful connection...",_serverAddress.toString().c_str());
Timestamp connectAttemptTime;
_serverConnection.connect(_publicAddress);
bool terminate=false;
while(running()) {
if(!sockets.process(_timeout)) {
if(connectAttemptTime.isElapsed(6000000)) {
_serverConnection.connect(_publicAddress);
connectAttemptTime.update();
}
continue;
}
if(_serverConnection.connected()) {
NOTE("RTMFP server %s successful connection",_serverAddress.toString().c_str());
RTMFPServer::run();
_serverConnection.clear();
if(_serverConnection.connected()) {
// Exception in RTMFPServer::run OR a volontary stop
_serverConnection.setEndPoint(_serverSocket,_serverAddress);
_serverConnection.disconnect();
break;
}
NOTE("RTMFP server %s connection lost",_serverAddress.toString().c_str());
}
}
_sendingEngine.clear();
sockets.remove(_serverSocket);
_serverSocket.close();
}