libzmq
src
polling_util.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: MPL-2.0 */
2
3
#include "
precompiled.hpp
"
4
#include "
polling_util.hpp
"
5
6
#if defined ZMQ_POLL_BASED_ON_POLL
7
#include <limits.h>
8
#include <algorithm>
9
10
zmq::timeout_t zmq::compute_timeout (
const
bool
first_pass_,
11
const
long
timeout_,
12
const
uint64_t now_,
13
const
uint64_t end_)
14
{
15
if
(first_pass_)
16
return
0;
17
18
if
(timeout_ < 0)
19
return
-1;
20
21
return
static_cast<
zmq::timeout_t
>
(
22
std::min<uint64_t> (end_ - now_, INT_MAX));
23
}
24
#endif
precompiled.hpp
polling_util.hpp
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:57