SliTaz Man Pages

Community Doc Forum Pro Shop Bugs Hg Cook

AN_SEND

Provided by antinat package
Section: Antinat Programmer's Manual (3)
Updated: 2005-02-25
Index Return to Main Contents

NAME

an_send - send incoming data to a proxy-capable socket

SYNOPSIS

#include <antinat.h>

int an_send(ANCONN s, void * buf, int length, int flags);

DESCRIPTION

The an_send(3) function is used to send incoming data to a proxy-capable socket. The socket must be in the accepted or connected state. If the socket is in blocking mode, the an_send(3) function will block until some data is successfully sent into the socket. In non-blocking mode, if no data can be sent, the return value will be -1, and errno set to EAGAIN. To fetch data back from the recipient of this data, use an_recv(3).

s is a socket previously created with an_new_connection(3), and accepted or connected with an_accept(3), an_connect_tohostname(3) or an_connect_tosockaddr(3).

buf is a buffer containing the data to send.

length is the number of bytes to send from the user supplied buffer.

flags are flags, reserved for future use. Currently, there are no flags guaranteed to be supported across versions of this library. This parameter must be zero.

RETURN VALUE

The return value is the number of bytes sent from buf, or -1 if an error occurs.

ERRORS

If an error occurs, the return value will be -1. errno will be set to provide more information about the cause of the error.

CONFORMING TO

This function appeared in Antinat 0.70.

SEE ALSO

an_accept(3), an_connect_tohostname(3), an_connect_tosockaddr(3), an_new_connection(3), an_recv(3)

AUTHOR

Malcolm Smith <malxau@users.sourceforge.net>

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
CONFORMING TO
SEE ALSO
AUTHOR