summaryrefslogtreecommitdiffstats
path: root/src/socket-server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket-server.h')
-rw-r--r--src/socket-server.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/socket-server.h b/src/socket-server.h
new file mode 100644
index 00000000..4814fc62
--- /dev/null
+++ b/src/socket-server.h
@@ -0,0 +1,18 @@
+#ifndef foosocketserverhfoo
+#define foosocketserverhfoo
+
+#include <inttypes.h>
+#include "mainloop.h"
+#include "iochannel.h"
+
+struct socket_server;
+
+struct socket_server* socket_server_new(struct mainloop *m, int fd);
+struct socket_server* socket_server_new_unix(struct mainloop *m, const char *filename);
+struct socket_server* socket_server_new_ipv4(struct mainloop *m, uint32_t address, uint16_t port);
+
+void socket_server_free(struct socket_server*s);
+
+void socket_server_set_callback(struct socket_server*s, void (*on_connection)(struct socket_server*s, struct iochannel *io, void *userdata), void *userdata);
+
+#endif