Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KDE Connect
Commits
006a0b8d
Commit
006a0b8d
authored
Sep 12, 2013
by
Tim Creech
Committed by
Albert Vaca Cintora
Sep 13, 2013
Browse files
Didn't build on FreeBSD because it does not define SOL_TCP
Replaced SOL_TCP with getprotobyname("TCP")->p_proto
BUG: 324766
parent
32a343fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
kded/devicelinks/landevicelink.cpp
View file @
006a0b8d
...
...
@@ -23,6 +23,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include "linkproviders/linkprovider.h"
#include "networkpackage.h"
...
...
@@ -40,10 +41,10 @@ LanDeviceLink::LanDeviceLink(const QString& d, LinkProvider* a, QTcpSocket* sock
setsockopt
(
fd
,
IPPROTO_TCP
,
TCP_KEEPIDLE
,
&
maxIdle
,
sizeof
(
maxIdle
));
int
count
=
3
;
// send up to 3 keepalive packets out, then disconnect if no response
setsockopt
(
fd
,
SOL_TCP
,
TCP_KEEPCNT
,
&
count
,
sizeof
(
count
));
setsockopt
(
fd
,
getprotobyname
(
"TCP"
)
->
p_proto
,
TCP_KEEPCNT
,
&
count
,
sizeof
(
count
));
int
interval
=
5
;
// send a keepalive packet out every 2 seconds (after the 5 second idle period)
setsockopt
(
fd
,
SOL_TCP
,
TCP_KEEPINTVL
,
&
interval
,
sizeof
(
interval
));
setsockopt
(
fd
,
getprotobyname
(
"TCP"
)
->
p_proto
,
TCP_KEEPINTVL
,
&
interval
,
sizeof
(
interval
));
connect
(
mSocket
,
SIGNAL
(
disconnected
()),
this
,
SLOT
(
deleteLater
()));
...
...
Write
Preview
Supports
Markdown
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