sock.c File Reference

Socket abstraction. More...

## Data Structures

struct | xmpp_sock_t

## Functions

void | sock_initialize (void)
void | sock_shutdown (void)
int | sock_error (struct conn_interface *intf)
static int | _in_progress (int error)
static void | sock_getaddrinfo (xmpp_sock_t *xsock)
xmpp_sock_t * | sock_new (xmpp_conn_t *conn, const char *domain, const char *host, unsigned short port)
void | sock_free (xmpp_sock_t *xsock)
static const char * | _sockaddr2str (struct sockaddr *sa, char *buf, size_t buflen)
sock_t | sock_connect (xmpp_sock_t *xsock)
int | sock_set_keepalive (sock_t sock, int timeout, int interval, int count, unsigned int user_timeout)
int | xmpp_sockopt_cb_keepalive (xmpp_conn_t *conn, void *socket)
| Example sockopt callback function An example function that can be used to set reasonable default keepalive options on sockets when registered for a connection with xmpp_conn_set_sockopt_callback().
int | sock_close (sock_t sock)
static int | _sock_set_blocking_mode (sock_t sock, int blocking)
int | sock_set_blocking (sock_t sock)
int | sock_set_nonblocking (sock_t sock)
int | sock_read (struct conn_interface *intf, void *buff, size_t len)
int | sock_write (struct conn_interface *intf, const void *buff, size_t len)
int | sock_is_recoverable (struct conn_interface *intf, int error)
int | sock_connect_error (sock_t sock)

## Variables

const struct conn_interface | sock_intf

## Detailed Description

Socket abstraction.

## Function Documentation

## sock_initialize()

void sock_initialize | ( | void |  | ) |

## sock_shutdown()

void sock_shutdown | ( | void |  | ) |

## sock_error()

int sock_error | ( | struct conn_interface * | intf | ) |

## _in_progress()

int _in_progress | ( | int | error | ) |

static

## sock_getaddrinfo()

void sock_getaddrinfo | ( | xmpp_sock_t * | xsock | ) |

static

## sock_new()

xmpp_sock_t * sock_new | ( | xmpp_conn_t * | conn,
|  | const char * | domain,
|  | const char * | host,
|  | unsigned short | port )

## sock_free()

void sock_free | ( | xmpp_sock_t * | xsock | ) |

## _sockaddr2str()

const char * _sockaddr2str | ( | struct sockaddr * | sa,
|  | char * | buf,
|  | size_t | buflen )

static

## sock_connect()

sock_t sock_connect | ( | xmpp_sock_t * | xsock | ) |

## sock_set_keepalive()

int sock_set_keepalive | ( | sock_t | sock,
|  | int | timeout,
|  | int | interval,
|  | int | count,
|  | unsigned int | user_timeout )

## sock_close()

int sock_close | ( | sock_t | sock | ) |

## _sock_set_blocking_mode()

int _sock_set_blocking_mode | ( | sock_t | sock,
|  | int | blocking )

static

## sock_set_blocking()

int sock_set_blocking | ( | sock_t | sock | ) |

## sock_set_nonblocking()

int sock_set_nonblocking | ( | sock_t | sock | ) |

## sock_read()

int sock_read | ( | struct conn_interface * | intf,
|  | void * | buff,
|  | size_t | len )

## sock_write()

int sock_write | ( | struct conn_interface * | intf,
|  | const void * | buff,
|  | size_t | len )

## sock_is_recoverable()

int sock_is_recoverable | ( | struct conn_interface * | intf,
|  | int | error )

## sock_connect_error()

int sock_connect_error | ( | sock_t | sock | ) |

## Variable Documentation

## sock_intf

const struct conn_interface sock_intf

Initial value:
= {
sock_read,
sock_write,
conn_int_nop,
conn_int_nop,
sock_error,
sock_is_recoverable,
NULL,
}
conn_int_nop
int conn_int_nop(struct conn_interface *intf)
Definition conn.c:1077
sock_write
int sock_write(struct conn_interface *intf, const void *buff, size_t len)
Definition sock.c:399
sock_is_recoverable
int sock_is_recoverable(struct conn_interface *intf, int error)
Definition sock.c:404
sock_read
int sock_read(struct conn_interface *intf, void *buff, size_t len)
Definition sock.c:394
sock_error
int sock_error(struct conn_interface *intf)
Definition sock.c:79