Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita07363c

Browse files
knizhnikkelvich
authored andcommitted
Set SO_KEEPALIVE
1 parentdc4fb75 commita07363c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎arbiter.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,15 @@ static int MtmReadSocket(int sd, void* buf, int buf_size)
239239
staticvoidMtmSetSocketOptions(intsd)
240240
{
241241
#ifdefTCP_NODELAY
242-
intoptval=1;
243-
if (setsockopt(sd,IPPROTO_TCP,TCP_NODELAY, (charconst*)&optval,sizeof(optval))<0) {
242+
inton=1;
243+
if (setsockopt(sd,IPPROTO_TCP,TCP_NODELAY, (charconst*)&on,sizeof(on))<0) {
244244
elog(WARNING,"Failed to set TCP_NODELAY: %m");
245245
}
246246
#endif
247+
if (setsockopt(sd,SOL_SOCKET,SO_KEEPALIVE, (charconst*)&on,sizeof(on))<0) {
248+
elog(WARNING,"Failed to set SO_KEEPALIVE: %m");
249+
}
250+
247251
if (tcp_keepalives_idle) {
248252
#ifdefTCP_KEEPIDLE
249253
if (setsockopt(sd,IPPROTO_TCP,TCP_KEEPIDLE,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp