logoalt Hacker News

hlinnakatoday at 10:17 AM1 replyview on HN

Because then the cancellation request would get queued behind any other data that's in flight from the client to the server. In the worst case the TCP buffers are full, and the client cannot even send the request until the server processes some of the existing data that's in-flight.


Replies

adrian_btoday at 12:03 PM

As others have said, TCP allows sending urgent packets, precisely for solving this problem.

At the receiver, a signal handler must be used, which will be invoked when an urgent packet is received, with SIGURG.