We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent4696afa commit1a8c8c5Copy full SHA for 1a8c8c5
contrib/mmts/arbiter.c
@@ -239,11 +239,15 @@ static int MtmReadSocket(int sd, void* buf, int buf_size)
239
staticvoidMtmSetSocketOptions(intsd)
240
{
241
#ifdefTCP_NODELAY
242
-intoptval=1;
243
-if (setsockopt(sd,IPPROTO_TCP,TCP_NODELAY, (charconst*)&optval,sizeof(optval))<0) {
+inton=1;
+if (setsockopt(sd,IPPROTO_TCP,TCP_NODELAY, (charconst*)&on,sizeof(on))<0) {
244
elog(WARNING,"Failed to set TCP_NODELAY: %m");
245
}
246
#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
+
251
if (tcp_keepalives_idle) {
252
#ifdefTCP_KEEPIDLE
253
if (setsockopt(sd,IPPROTO_TCP,TCP_KEEPIDLE,