Your ad here would be seen by 100,000 unique vistors every month Haxx ad

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on


cURL > Mailing List > Monthly Index > Single Mail

curl-and-python mailing list Archives

Callback for socket closing event

From: Arek Bochinski <>
Date: Thu, 1 Oct 2009 23:57:21 -0400

I would like to register a callback for an event when a socket is about to
be closed by external http server.
For instance, If I send an http1.1 request, and the server replies with a
connection: close , pycurl will handle the
file descriptor closing ( i think ) .

Above behavior, creates a problem as the file descriptor needs to be
unregistered from an IO loop ( epoll ) and by the time
the descriptor tries to be unregistered by epoll, the epoll mechanism throws
an error:

OSError: [Errno 9] Bad file descriptor

So in effect, is it possible to capture the pre-closing event in pycurl ->
pass it to epoll to unregister events for this fd -> and the allow pycurl to
close the descritor if it wishes ?

Received on 2009-10-02

These mail archives are generated by hypermail.

donate! Page updated September 25, 2009.
web site info

File upload with ASP.NET