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
3b8254da
Commit
3b8254da
authored
Feb 18, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #900 from pijyoi/master
fix: win32 tcp_keepalive gets set even when option is -1
parents
1879b8ba
9d3d9d63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
tcp.cpp
src/tcp.cpp
+9
-7
No files found.
src/tcp.cpp
View file @
3b8254da
...
...
@@ -95,13 +95,15 @@ void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int
// Tuning TCP keep-alives if platform allows it
// All values = -1 means skip and leave it for OS
#ifdef ZMQ_HAVE_WINDOWS
tcp_keepalive
keepalive_opts
;
keepalive_opts
.
onoff
=
keepalive_
;
keepalive_opts
.
keepalivetime
=
keepalive_idle_
!=
-
1
?
keepalive_idle_
*
1000
:
7200000
;
keepalive_opts
.
keepaliveinterval
=
keepalive_intvl_
!=
-
1
?
keepalive_intvl_
*
1000
:
1000
;
DWORD
num_bytes_returned
;
int
rc
=
WSAIoctl
(
s_
,
SIO_KEEPALIVE_VALS
,
&
keepalive_opts
,
sizeof
(
keepalive_opts
),
NULL
,
0
,
&
num_bytes_returned
,
NULL
,
NULL
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
if
(
keepalive_
!=
-
1
)
{
tcp_keepalive
keepalive_opts
;
keepalive_opts
.
onoff
=
keepalive_
;
keepalive_opts
.
keepalivetime
=
keepalive_idle_
!=
-
1
?
keepalive_idle_
*
1000
:
7200000
;
keepalive_opts
.
keepaliveinterval
=
keepalive_intvl_
!=
-
1
?
keepalive_intvl_
*
1000
:
1000
;
DWORD
num_bytes_returned
;
int
rc
=
WSAIoctl
(
s_
,
SIO_KEEPALIVE_VALS
,
&
keepalive_opts
,
sizeof
(
keepalive_opts
),
NULL
,
0
,
&
num_bytes_returned
,
NULL
,
NULL
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
}
#else
#ifdef ZMQ_HAVE_SO_KEEPALIVE
if
(
keepalive_
!=
-
1
)
{
...
...
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