#include <string.h>#include <errno.h>#include <sys/poll.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/uio.h>#include "dprint.h"

Go to the source code of this file.
Defines | |
| #define | TSEND_ERR_CHECK(f_name) |
| #define | TSEND_INIT |
| #define | TSEND_POLL(f_name) |
Functions | |
| int | tsend_dgram (int fd, char *buf, unsigned int len, const struct sockaddr *to, socklen_t tolen, int timeout) |
| sends on dgram fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR | |
| int | tsend_dgram_ev (int fd, const struct iovec *v, int count, int timeout) |
| sends on connected datagram fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR | |
| int | tsend_stream (int fd, char *buf, unsigned int len, int timeout) |
| sends on fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR | |
| #define TSEND_ERR_CHECK | ( | f_name | ) |
Definition at line 74 of file tsend.c.
Referenced by tsend_dgram(), tsend_dgram_ev(), and tsend_stream().
| #define TSEND_INIT |
Value:
int n; \ struct pollfd pf; \ pf.fd=fd; \ pf.events=POLLOUT
Definition at line 42 of file tsend.c.
Referenced by tsend_dgram(), tsend_dgram_ev(), and tsend_stream().
| #define TSEND_POLL | ( | f_name | ) |
Definition at line 48 of file tsend.c.
Referenced by tsend_dgram(), tsend_dgram_ev(), and tsend_stream().
| int tsend_dgram | ( | int | fd, | |
| char * | buf, | |||
| unsigned int | len, | |||
| const struct sockaddr * | to, | |||
| socklen_t | tolen, | |||
| int | timeout | |||
| ) |
sends on dgram fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR
Definition at line 129 of file tsend.c.
References TSEND_ERR_CHECK, TSEND_INIT, and TSEND_POLL.
| int tsend_dgram_ev | ( | int | fd, | |
| const struct iovec * | v, | |||
| int | count, | |||
| int | timeout | |||
| ) |
sends on connected datagram fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR
Definition at line 151 of file tsend.c.
References TSEND_ERR_CHECK, TSEND_INIT, and TSEND_POLL.
Referenced by write_to_unixsock().
| int tsend_stream | ( | int | fd, | |
| char * | buf, | |||
| unsigned int | len, | |||
| int | timeout | |||
| ) |
sends on fd (which must be O_NONBLOCK); if it cannot send any data in timeout milliseconds it will return ERROR
Definition at line 92 of file tsend.c.
References MSG_NOSIGNAL, TSEND_ERR_CHECK, TSEND_INIT, and TSEND_POLL.
1.5.6