Parrot Socket I/O - request for help

Allison Randal allison at parrot.org
Fri Mar 27 01:37:35 UTC 2009


Mark Glines wrote:
> 
> I've updated the httpd.pir example to use pmc methods as much as
> possible.  There were two ops I couldn't eliminate: "socket" and
> "sockaddr".  There doesn't seem to be a way to create Socket and
> SockAddr objects directly and initialize them correctly... there's no
> way to set the address of an existing SockAddr object, and no way to
> specify e.g. AF_INET, SOCK_STREAM and all of that for an existing Socket
> object.

So, methods or vtable functions for those behaviors need to be added.

In the pdd, the Socket PMC has a 'socket' method (essentially parallel 
to the 'open' method on the FileHandle PMC). You should be able to 
create a Socket PMC with the standard 'new':

   $P0 = new 'Socket'
   $P1 = new 'Socket', init_hash

Allison


More information about the parrot-dev mailing list