summaryrefslogtreecommitdiffstats
path: root/lib/net/server.h
diff options
context:
space:
mode:
authormrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-20 21:50:25 +0300
committermrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-20 21:50:58 +0300
commit6416c8feecc760807f4edf5d9c8e8be9c2df8981 (patch)
tree8a8b734e3ab97060c7ed239f6217b5985b7f1189 /lib/net/server.h
parent78bd565b9c54a962e28ea4865be286b0605ca941 (diff)
feat(lib/net): network library implemented
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