38 const char *buf,
size_t len)
54 printf(
"Exiting....\n");
59 int main(
int argc,
char *argv[])
66 settings.
port = HPD_TCPD_P_HTTP_ALT;
71 printf(
"Debugging is set\n");
hpd_error_t hpd_tcpd_create(hpd_tcpd_t **tcpd, hpd_tcpd_settings_t *settings, const hpd_module_t *context, hpd_ev_loop_t *loop)
Create new tcpd instance.
hpd_tcpd_port_t port
Port number.
struct hp_settings settings
hpd_error_t hpd_tcpd_stop(hpd_tcpd_t *tcpd)
Stop an already running tcpd.
hpd_error_t hpd_tcpd_start(hpd_tcpd_t *tcpd)
Start the tcpd.
All data to represent a connection.
hpd_error_t hpd_tcpd_conn_sendf(hpd_tcpd_conn_t *conn, const char *fmt,...)
Send message on connection.
static struct ev_loop * loop
int main(int argc, char *argv[])
hpd_tcpd_data_f on_receive
static void exit_handler(int sig)
struct ev_loop hpd_ev_loop_t
hpd_error_t hpd_tcpd_destroy(hpd_tcpd_t *tcpd)
Destroy tcpd and free used memory.
Settings struct for tcpd.
#define HPD_TCPD_SETTINGS_DEFAULT
Default settings for tcpd.
static int on_receive(hpd_tcpd_t *instance, hpd_tcpd_conn_t *conn, void *ctx, void **data, const char *buf, size_t len)