Am 29.12.2013 06:13, schrieb Theron Luhn:
> I overlooked something: As long as the server is sending data, a TCP
> timeout will occur after a while and the connection will be closed. And
> since the application I'm writing uses PubSub heavily, this shouldn't be
> a problem.
>
> But if the community doesn't mind answering, though, I still am curious :)
If a TCP client program is stopped, killed or the OS is shut down, the
TCP networking stack within the OS will (normally) actively close the
TCP connection, and your server will immediately recognize. The TCP
closing involves sending IP packets to the server.
If you pull the plug or the networking wire on a TCP client, no active
close is (obviously) being done. And this appears to your server as if
the client was just inactive.
Hence, to have the server recognize the latter situation and
differentiate it from mere inactivity, your server must send data.
On the TCP level, there is a retransmission timeout, and then multiple
retransmission attempts, and it takes quite long until TCP gives up and
reports the client as unreachable.
On the WebSocket level, you can do WebSocket pings. The WS peer must
pong back. If that isn't received in a timely manner you can bail out.
Moreso: the timeout is under your control.
/Tobias
>
>
> � Theron
>
>
> On Sat, Dec 28, 2013 at 8:09 PM, Theron Luhn <
tjl...@gmail.com
> <mailto:
tjl...@gmail.com>> wrote:
>
> This is a problem I have encountered in previous Twisted servers
> I've written.
>
> If a client disconnects uncleanly, Twisted won't be aware of the
> disconnect and the connection will persist server side. After a
> while, hundreds of these unused connections can accumulate.
>
> Does Autobahn handle this? Or will I need to use something like
> TimeoutFactory
> <
http://twistedmatrix.com/documents/11.0.0/api/twisted.protocols.policies.TimeoutFactory.html>
> <mailto:
autobahnws%2Bunsu...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send