[Twisted-Python] socket error 22

Eric Faurot eric.faurot at gmail.com
Tue May 13 06:26:21 EDT 2008

On Thu, May 8, 2008 at 8:14 PM, Jean-Paul Calderone <exarkun at divmod.com> wrote:

>  I wonder if OpenBSD gives back EINVAL for getsockname(2) when the peer has
>  done a shutdown of the socket.  Can you tell me what this program does?
>    from socket import socket
>    port = socket()
>    port.bind(('', 0))
>    port.listen(1)
>    client = socket()
>    client.setblocking(False)
>    client.connect_ex(port.getsockname())
>    server, clientAddr = port.accept()
>    print 'Before close', server.getsockname()
>    client.close()
>    print 'After close', server.getsockname()
>  If it finishes without error, try it with a time.sleep(5) before the final
>  line.

The program works fine in both case.

>  Also, to re-iterate what I believe someone else already said in this
> thread,
>  the best way to have Twisted work on OpenBSD is for there to be an OpenBSD
>  buildslave.  It's easy to set up new buildslaves, the only requirements are
>  that the machine can make outgoing TCP connections to the master and that
> it
>  can run the Twisted test suite whenever there's a trunk change or someone
>  needs to test something on the platform.

I wish I could do something, but I don't have a "spare" machine for this atm.


More information about the Twisted-Python mailing list