Re:Server Sent Events
by VWWHFSfQ on Monday May 15, 2023 @04:27PM
(#35954054)
You pretty much just have to listen for and handle premature closing of the underlying TCP connection. It's the only form of dead peer detection you'll get if someone just abrubtly closes their browser tab.
[ Parent
| on HN ]
Re:Server Sent Events
by teaearlgraycold on Monday May 15, 2023 @04:49PM
(#35954295)
Do server frameworks really require you to think of the TCP connection?
High performance servers and frameworks will always have to think about the underlying sockets
Re:Server Sent Events
by DaiPlusPlus on Tuesday May 16, 2023 @02:29AM
(#35958333)
Not TCP specifically, but ASP.NET Core binds your controller/action methods' CancellationToken parameter (if present) to HttpContext.RequestAborted - so assuming one uses it correctly (e.g. tying it to things like SQL TRANSACTION/ROLLBACK) then that helps prevent inadvertent changes if the user clicked their browser's Stop button after a POST, or gracefully handle long file upload failures, and so on.