How to abort a chunked connection #6419
Replies: 1 comment
-
Posted at 2021-04-05 by Robin Mon 2021.04.05 Although I haven't tried as your example implies, has an attempt to use this function been tried? See: Posted at 2021-04-05 by akot @robin yes, I've tried calling end(), but I'm getting an error: Posted at 2021-04-05 by Robin A little trickier than I first thought. In all articles I've been able to find so far, the same socket is used for efficiency, and would explain the 'Closed' error after each chunk that was seen. It appears that it needs to be understood what the server API requirements are for your specific "https ://someapi.com" domain to terminate as so desired. Would it be possible to supply that web service link for others to tackle perhaps?
> https://stackoverflow.com/questions/57011365/chunked-transfer-encoding-terminator-sequence-and-tcp-recv Posted at 2021-04-06 by akot @robin thanks for your response. Unfortunately I have no control over the API and like I said it keeps sending chunked data and never stops doing it. Based on your hint I rewrote my code using tls and plain HTTP like so:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-04-05 by akot
Hello!
I connect to some API that continuously sends events via a chunked transfer ("Transfer-Encoding": "chunked"). My goal is to terminate the request after receiving a specific event.
How can I achieve it? I know that get returns a httpCRq object, but it doesn't have abort() or destroy() methods. If I keep the connection open, it consumes a lot of memory, so I need to close it.
Beta Was this translation helpful? Give feedback.
All reactions