本文整理汇总了C++中TimeInterval::AsTimeval方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeInterval::AsTimeval方法的具体用法?C++ TimeInterval::AsTimeval怎么用?C++ TimeInterval::AsTimeval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeInterval
的用法示例。
在下文中一共展示了TimeInterval::AsTimeval方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUpReconnectTimeout
void AvahiDiscoveryAgent::SetUpReconnectTimeout() {
// We don't strictly need an ExponentialBackoffPolicy here because the client
// goes into the AVAHI_CLIENT_CONNECTING state if the server isn't running.
// Still, it's a useful defense against spinning rapidly if something goes
// wrong.
TimeInterval delay = m_backoff.Next();
OLA_INFO << "Re-creating avahi client in " << delay << "s";
struct timeval tv;
delay.AsTimeval(&tv);
const AvahiPoll *poll = avahi_threaded_poll_get(m_threaded_poll);
if (m_reconnect_timeout) {
poll->timeout_update(m_reconnect_timeout, &tv);
} else {
m_reconnect_timeout = poll->timeout_new(
avahi_threaded_poll_get(m_threaded_poll),
&tv,
reconnect_callback,
this);
}
}