|
Data Structures |
struct | gnutella_socket |
Defines |
#define | SOCKET_WITH_TLS(s) ((void) (s), 0) |
#define | SOCKET_USES_TLS(s) ((void) (s), 0) |
#define | SOCK_F_ESTABLISHED 0x00000001 /**< Connection was established */ |
| Connection was established.
|
#define | SOCK_F_EOF 0x00000002 /**< Got an EOF condition */ |
| Got an EOF condition.
|
#define | SOCK_F_UDP 0x40000000 /**< Is a UDP socket */ |
| Is a UDP socket.
|
#define | SOCK_F_TCP 0x80000000 /**< Is a TCP socket */ |
| Is a TCP socket.
|
#define | sock_is_corked(x) ((x)->corked) |
| Access macros.
|
#define | udp_active() (enable_udp && NULL != s_udp_listen) |
| This macro verifies whether UDP support is enabled and if the UDP socket has been initialized.
|
Enumerations |
enum | socket_direction { SOCK_CONN_INCOMING,
SOCK_CONN_OUTGOING,
SOCK_CONN_LISTENING,
SOCK_CONN_PROXY_OUTGOING
} |
enum | socket_type {
SOCK_TYPE_UNKNOWN = 0,
SOCK_TYPE_CONTROL,
SOCK_TYPE_DOWNLOAD,
SOCK_TYPE_UPLOAD,
SOCK_TYPE_HTTP,
SOCK_TYPE_SHELL,
SOCK_TYPE_CONNBACK,
SOCK_TYPE_PPROXY,
SOCK_TYPE_DESTROYING,
SOCK_TYPE_UDP
} |
| Connection types. More...
|
Functions |
void | socket_init (void) |
void | socket_register_fd_reclaimer (reclaim_fd_t callback) |
| Register fd reclaiming callback.
|
void | socket_eof (struct gnutella_socket *s) |
| Got an EOF condition on the socket.
|
void | socket_free (struct gnutella_socket *) |
| Dispose of socket, closing connection, removing input callback, and reclaiming attached getline buffer.
|
gnutella_socket * | socket_connect (const host_addr_t, guint16, enum socket_type, guint32 flags) |
| Creates a connected socket with an attached resource of `type'.
|
gnutella_socket * | socket_connect_by_name (const gchar *host, guint16, enum socket_type, guint32 flags) |
| Like socket_connect() but the remote address is not known and must be resolved through async DNS calls.
|
gnutella_socket * | socket_tcp_listen (const host_addr_t, guint16, enum socket_type) |
| Creates a non-blocking TCP listening socket with an attached resource of `type'.
|
gnutella_socket * | socket_udp_listen (const host_addr_t, guint16) |
| Creates a non-blocking listening UDP socket.
|
void | socket_evt_set (struct gnutella_socket *s, inputevt_cond_t cond, inputevt_handler_t handler, gpointer data) |
| Install handler callback when an input condition is satisfied on the socket.
|
void | socket_evt_clear (struct gnutella_socket *s) |
| Remove I/O readiness monitoring on the socket.
|
void | sock_cork (struct gnutella_socket *s, gboolean on) |
| Set/clear TCP_CORK on the socket.
|
void | sock_send_buf (struct gnutella_socket *s, gint size, gboolean shrink) |
| Set socket's send buffer to specified size.
|
void | sock_recv_buf (struct gnutella_socket *s, gint size, gboolean shrink) |
| Set socket's receive buffer to specified size.
|
void | sock_nodelay (struct gnutella_socket *s, gboolean on) |
| Turn TCP_NODELAY on or off on the socket.
|
void | sock_tx_shutdown (struct gnutella_socket *s) |
| Shutdown the TX side of the socket.
|
void | socket_tos_default (const struct gnutella_socket *s) |
void | socket_tos_throughput (const struct gnutella_socket *s) |
| Set the Type of Service (TOS) field to "throughput." This may cause your host and/or any routers along the path to put its packets in a lower-priority queue, and/or to route them along the highest- bandwidth path without regard for latency.
|
void | socket_tos_lowdelay (const struct gnutella_socket *s) |
| Set the Type of Service (TOS) field to "lowdelay." This may cause your host and/or any routers along the path to put its packets in a higher-priority queue, and/or to route them along the lowest- latency path without regard for bandwidth.
|
void | socket_tos_normal (const struct gnutella_socket *s) |
| Set the Type of Service (TOS) field to "normal.".
|
gboolean | socket_bad_hostname (struct gnutella_socket *s) |
void | socket_timer (time_t now) |
| Called by main timer.
|
void | socket_shutdown (void) |
| Cleanup data structures on shutdown.
|
ssize_t | safe_readv (wrap_io_t *wio, struct iovec *iov, gint iovcnt) |
| Wrapper over readv() ensuring that we don't request more than MAX_IOV_COUNT entries at a time.
|
ssize_t | safe_writev (wrap_io_t *wio, struct iovec *iov, gint iovcnt) |
| Wrapper over writev() ensuring that we don't request more than MAX_IOV_COUNT entries at a time.
|
ssize_t | safe_writev_fd (gint fd, struct iovec *iov, gint iovcnt) |
| Wrapper over writev() ensuring that we don't request more than MAX_IOV_COUNT entries at a time.
|
Variables |
gnutella_socket * | s_tcp_listen |
gnutella_socket * | s_udp_listen |