Macaw OS C reference

Function net_send

#include <macaw.h>
int net_send(int s, const void *data, int n);

Sends bytes down a connection. Anything you send while it's still connecting goes once it's open.

Parameters

sint
The connection's number, from net_connect or net_accept.
dataconst void *
The bytes to send, such as a string or an array.
nint
How many bytes to send. For a string, that's strlen(data).

Returns int

How many bytes it took to send, or 0 if the connection has closed.

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