MPD
Typedefs | Functions
server_socket.h File Reference
#include <stdbool.h>
#include <glib.h>

Go to the source code of this file.

Typedefs

typedef void(* server_socket_callback_t )(int fd, const struct sockaddr *address, size_t address_length, int uid, void *ctx)
 

Functions

struct server_socket * server_socket_new (server_socket_callback_t callback, void *callback_ctx)
 
void server_socket_free (struct server_socket *ss)
 
bool server_socket_open (struct server_socket *ss, GError **error_r)
 
void server_socket_close (struct server_socket *ss)
 
bool server_socket_add_port (struct server_socket *ss, unsigned port, GError **error_r)
 Add a listener on a port on all interfaces.
 
bool server_socket_add_host (struct server_socket *ss, const char *hostname, unsigned port, GError **error_r)
 Resolves a host name, and adds listeners on all addresses in the result set.
 
bool server_socket_add_path (struct server_socket *ss, const char *path, GError **error_r)
 Add a listener on a Unix domain socket.
 

Typedef Documentation

typedef void(* server_socket_callback_t)(int fd, const struct sockaddr *address, size_t address_length, int uid, void *ctx)

Definition at line 29 of file server_socket.h.

Function Documentation

bool server_socket_add_host ( struct server_socket *  ss,
const char *  hostname,
unsigned  port,
GError **  error_r 
)

Resolves a host name, and adds listeners on all addresses in the result set.

Parameters
hostnamethe host name to be resolved
portthe TCP port
error_rlocation to store the error occuring, or NULL to ignore errors
Returns
true on success
bool server_socket_add_path ( struct server_socket *  ss,
const char *  path,
GError **  error_r 
)

Add a listener on a Unix domain socket.

Parameters
paththe absolute socket path
error_rlocation to store the error occuring, or NULL to ignore errors
Returns
true on success
bool server_socket_add_port ( struct server_socket *  ss,
unsigned  port,
GError **  error_r 
)

Add a listener on a port on all interfaces.

Parameters
portthe TCP port
error_rlocation to store the error occuring, or NULL to ignore errors
Returns
true on success
void server_socket_close ( struct server_socket *  ss)
void server_socket_free ( struct server_socket *  ss)
struct server_socket* server_socket_new ( server_socket_callback_t  callback,
void *  callback_ctx 
)
read
bool server_socket_open ( struct server_socket *  ss,
GError **  error_r 
)