NAME ^

src/io/socket_api.c - Socket I/O API

DESCRIPTION ^

These are the primary interface functions for working with socket objects.

Networking Functions ^

INTVAL Parrot_io_poll

Polls *pmc for the events in which every sec seconds + usec microseconds.

PMC *Parrot_io_socket

Creates and returns a socket using the specified address family, socket type, and protocol number. Check the returned PMC with a boolean test to see whether the socket was successfully created.

INTVAL Parrot_io_recv

Receives a message from the connected socket *pmc in *buf. Returns -1 if it fails.

INTVAL Parrot_io_send

Sends the message *buf to the connected socket *pmc. Returns -1 if it cannot send the message.

INTVAL Parrot_io_connect

Connects *pmc to *address. Returns -1 on failure.

INTVAL Parrot_io_bind

Binds *pmc's socket to the local address and port specified by *address. Returns -1 on failure.

INTVAL Parrot_io_listen

Listens for new connections on socket *pmc. Returns -1 on failure.

PMC *Parrot_io_accept

Accepts a new connection and returns a newly created ParrotIO socket. Returns NULL on failure.

SEE ALSO ^

io/api.c


parrot