aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
new file mode 100644
index 0000000..f5107b5
--- /dev/null
+++ b/src/server.h
@@ -0,0 +1,17 @@
+#ifndef SERVER_H
+#define SERVER_H
+
+typedef struct sock_t sock_t;
+struct sock_t;
+
+int server_start(char *port, sock_t *sock);
+int server_accept(sock_t *sock, sock_t *conn);
+
+ssize_t server_send(sock_t *sock, char *buf, size_t sz);
+ssize_t server_recv(sock_t *sock, char *buf, size_t sz);
+char *server_connection_ip(sock_t *conn);
+
+sock_t *server_sock_create();
+void server_sock_close(sock_t *s);
+
+#endif