[perl #83866] IO::Socket::INET Couldn't create socket.

Nick Wellnhofer wellnhofer at aevum.de
Wed Mar 16 20:43:55 UTC 2011


On 16/03/11 14:44, Cosimo Streppone via RT wrote:
> Bug still present for me in:
>
> This is Rakudo Perl 6, version 2011.02-55-ge3bd9aa built on parrot
> 3.2.0 RELEASE_3_2_0
>
> I tried having a look at the source code, starting from the error
> message ("Can't connect closed socket"), and it seems to me that:
>
> * the FileHandle PMC os_handle attribute is set to PIO_INVALID_HANDLE
> at initialization time
> * when trying to open the socket with Parrot_io_connect_handle(),
> Parrot_io_is_closed_handle() is called, which compares the os_handle
> attribute with PIO_INVALID_HANDLE
> * a match is found, so the handle is assumed to be closed, and this
> stops any attempt to connect.

That's because the 'socket' method of the Socket PMC has to be called 
first. The open method in IO::Socket::INET doesn't do that, so it should 
be fixed there.

Nick


More information about the parrot-dev mailing list