personal_cloud
personal_cloud

Reputation: 4504

Force browsers to close TCP connections on refresh

I am developing an embedded web server. If I enable keep-alive, then every time I unplug, re-flash, and replug the server, the Chrome/Firefox refresh buttons don't work, because the browser tries to re-use a connection that was not established since the last server boot.

Curl does not have this problem, because it automatically creates a new connection every time you call it (even if using keep-alive).

I know I could turn off keep-alive, or have the server send TCP reset packets in response to data segments on non-existing connections. But those hacks have their own issues. Having the browser automatically reset its connections when I click refresh would seem a lot more logical. Is there a way to do that?

Upvotes: 0

Views: 1856

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123395

Having the browser automatically reset its connections when I click refresh would seem a lot more logical.

I don't think this would be more logical. Instead of fixing a single server by having a properly behaving TCP stack (i.e. send RST for non-existing connections RFC 793 #3.4 'Reset generation') you expect a change in every client which might connect to the server.

Given that Chrome and Firefox are open source you can change the source code of it and install it on all affected clients. But there is as far as I know no setting in these browsers to change the behavior in a way you want. And then are also other browsers which you would need to change to and roll out these changes to all clients - this just does not scale.

Upvotes: 3

Related Questions