From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Wen Yi <896634148@qq.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: [Question]What will happen if the server active close the connection?
Date: Mon, 05 Jun 2023 09:27:12 +0200
Message-ID: <ae92b173bc848d68bb178886518ca8489e3c4993.camel@cybertec.at> (raw)
In-Reply-To: <tencent_4D201BE356DCC8A4375C68EBD057774D6709@qq.com>
References: <tencent_4D201BE356DCC8A4375C68EBD057774D6709@qq.com>
On Mon, 2023-06-05 at 10:18 +0800, Wen Yi wrote:
> when I study the tcp connection, I found that if the server active close the connection,
> the server will send a fin package to the client and the client will reply a ack package.
> As this:
>
> Server ---->(FIN) Client
> Server <----(ACK) Client
>
> My question is, in so many articles, the following step is, the client will write some
> data(send some data) to the server and then cause the signal SIGNALPIPE.
> But what will happen if the client died?(Example: was killed by the user)
If the server has already closed the connection, nothing much will happen.
If the client never sends ACK to the FIN, the session will still time out.
You can fiddle with the tcp_keepalives_* parameters to influence that.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, 896634148@qq.com
Subject: Re: [Question]What will happen if the server active close the connection?
In-Reply-To: <ae92b173bc848d68bb178886518ca8489e3c4993.camel@cybertec.at>
References: <tencent_4D201BE356DCC8A4375C68EBD057774D6709@qq.com> <ae92b173bc848d68bb178886518ca8489e3c4993.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox