Macaw OS C reference

Function net_listen

#include <macaw.h>
int net_listen(int port);

Starts listening on a port, so other people on the Macaw network can connect to you at yourname.macaw.

Parameters

portint
The port to listen on, like 7000. 0 picks a free one from 40000 to 60000, and net_port says which.

Returns int

A number for the listener, or 0 if it couldn't, because Macaw OS isn't online or the port is in use.

In The network, with net_online, net_dial, net_connect, net_send, net_readline, net_read, net_receive, net_status, net_peer, net_close, net_accept, net_port.