ae::http socket - what really happens?
Marc Lehmann
schmorp at schmorp.de
Fri Mar 9 08:44:55 CET 2012
On Thu, Mar 08, 2012 at 05:18:02PM -0800, gleeco <gleeco at gmail.com> wrote:
> the doc says: "When called in void context, nothing is returned. In other
> contexts, http_request returns a "cancellation guard" - you have to keep
> the object at least alive until the callback get called. If the object gets
> destroyed before the callback is called, the request will be cancelled."
>
> in a keepalive request, what actually happens at the fh/socket level if i
> destroy the object --and then try another request? does AE::HTTP remove
> that fh/slot?
The exactly same thing happens (or should happen): the request is
cancelled. If you have another requets running while your first is still
unfinished, then keepalive will not (be able to) reuse the socket - only
when a request has completely finished will the socket become available
for reuse in another request.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
More information about the anyevent
mailing list