|
|
|
|
|
by dcherman
3683 days ago
|
|
The request is already in flight, it's too late - you can't abort those packets from getting to your server, you can only send new ones (which maybe instruct the server to disregard your search or something). The correct way to accomplish what you want is to either throttle or debounce your searching such that you reduce the amount of requests made in the first place. |
|
1) because clients throttle connections. Suppose a user wants to navigate, you may need to be able to cancel in flight requests or the next page load might be significantly delayed.
2) file uploads can have potentially gigs of packets that haven't been sent yet, which you definitely need to be able to cancel.