Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
c0ca2be6
Commit
c0ca2be6
authored
Aug 04, 2015
by
KIU Shueng Chuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ZMQ_CONNECT_TIMEOUT socket option
parent
4a0bde81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
zmq.h
include/zmq.h
+1
-0
options.cpp
src/options.cpp
+15
-0
options.hpp
src/options.hpp
+5
-0
No files found.
include/zmq.h
View file @
c0ca2be6
...
...
@@ -320,6 +320,7 @@ ZMQ_EXPORT uint32_t zmq_msg_get_routing_id(zmq_msg_t *msg);
#define ZMQ_HEARTBEAT_TTL 76
#define ZMQ_HEARTBEAT_TIMEOUT 77
#define ZMQ_XPUB_VERBOSE_UNSUBSCRIBE 78
#define ZMQ_CONNECT_TIMEOUT 79
/* Message options */
#define ZMQ_MORE 1
...
...
src/options.cpp
View file @
c0ca2be6
...
...
@@ -46,6 +46,7 @@ zmq::options_t::options_t () :
tos
(
0
),
type
(
-
1
),
linger
(
-
1
),
connect_timeout
(
0
),
reconnect_ivl
(
100
),
reconnect_ivl_max
(
0
),
backlog
(
100
),
...
...
@@ -158,6 +159,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break
;
case
ZMQ_CONNECT_TIMEOUT
:
if
(
is_int
&&
value
>=
0
)
{
connect_timeout
=
value
;
return
0
;
}
break
;
case
ZMQ_RECONNECT_IVL
:
if
(
is_int
&&
value
>=
-
1
)
{
reconnect_ivl
=
value
;
...
...
@@ -653,6 +661,13 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break
;
case
ZMQ_CONNECT_TIMEOUT
:
if
(
is_int
)
{
*
value
=
connect_timeout
;
return
0
;
}
break
;
case
ZMQ_RECONNECT_IVL
:
if
(
is_int
)
{
*
value
=
reconnect_ivl
;
...
...
src/options.hpp
View file @
c0ca2be6
...
...
@@ -92,6 +92,11 @@ namespace zmq
// Linger time, in milliseconds.
int
linger
;
// Maximum interval in milliseconds beyond which userspace will
// timeout connect().
// Default 0 (unused)
int
connect_timeout
;
// Minimum interval between attempts to reconnect, in milliseconds.
// Default 100ms
int
reconnect_ivl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment