Monero
Loading...
Searching...
No Matches
asyncsendto.c File Reference
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <syslog.h>
#include <errno.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <inttypes.h>
#include "asyncsendto.h"
#include "upnputils.h"
Include dependency graph for asyncsendto.c:

Classes

struct  scheduled_send

Macros

#define FINALIZE_SENDTO_DELAY   (500)

Enumerations

enum  send_state { ESCHEDULED =1 , EWAITREADY =2 , ESENDNOW =3 }

Functions

static LIST_HEAD (listhead, scheduled_send)
static ssize_t send_from_to (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr_in6 *src_addr, const struct sockaddr *dest_addr, socklen_t addrlen)
ssize_t sendto_schedule2 (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen, const struct sockaddr_in6 *src_addr, unsigned int delay)
ssize_t sendto_or_schedule (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
ssize_t sendto_or_schedule2 (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen, const struct sockaddr_in6 *src_addr)
int get_next_scheduled_send (struct timeval *next_send)
int get_sendto_fds (fd_set *writefds, int *max_fd, const struct timeval *now)
int try_sendto (fd_set *writefds)
void finalize_sendto (void)

Variables

enum send_state state

Macro Definition Documentation

◆ FINALIZE_SENDTO_DELAY

#define FINALIZE_SENDTO_DELAY   (500)

Enumeration Type Documentation

◆ send_state

enum send_state
Enumerator
ESCHEDULED 
EWAITREADY 
ESENDNOW 

Function Documentation

◆ finalize_sendto()

void finalize_sendto ( void )

◆ get_next_scheduled_send()

int get_next_scheduled_send ( struct timeval * next_send)

◆ get_sendto_fds()

int get_sendto_fds ( fd_set * writefds,
int * max_fd,
const struct timeval * now )

◆ LIST_HEAD()

LIST_HEAD ( listhead ,
scheduled_send  )
static

◆ send_from_to()

ssize_t send_from_to ( int sockfd,
const void * buf,
size_t len,
int flags,
const struct sockaddr_in6 * src_addr,
const struct sockaddr * dest_addr,
socklen_t addrlen )
static

◆ sendto_or_schedule()

ssize_t sendto_or_schedule ( int sockfd,
const void * buf,
size_t len,
int flags,
const struct sockaddr * dest_addr,
socklen_t addrlen )

◆ sendto_or_schedule2()

ssize_t sendto_or_schedule2 ( int sockfd,
const void * buf,
size_t len,
int flags,
const struct sockaddr * dest_addr,
socklen_t addrlen,
const struct sockaddr_in6 * src_addr )

◆ sendto_schedule2()

ssize_t sendto_schedule2 ( int sockfd,
const void * buf,
size_t len,
int flags,
const struct sockaddr * dest_addr,
socklen_t addrlen,
const struct sockaddr_in6 * src_addr,
unsigned int delay )

◆ try_sendto()

int try_sendto ( fd_set * writefds)

Variable Documentation

◆ state

enum send_state state