summaryrefslogtreecommitdiffstats
path: root/lib/net/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/server.h')
-rw-r--r--lib/net/server.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/net/server.h b/lib/net/server.h
new file mode 100644
index 0000000..b363724
--- /dev/null
+++ b/lib/net/server.h
@@ -0,0 +1,16 @@
+#ifndef NET__SERVER_H
+#define NET__SERVER_H
+
+#include "./common.h"
+
+typedef struct {
+ int listen_socket_fd;
+} server_t;
+
+server_t* server_init_tcp(const char* addr, const char* port);
+void server_shutdown(server_t* srv);
+
+conn_t* conn_try_accept(server_t* srv);
+void conn_close(conn_t* conn);
+
+#endif // NET__SERVER_H