From 440cfeee71829308fa1cc9b5aef63beb7ab756dc Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 31 Oct 2026 01:24:18 +0100 Subject: Refactor all tcp specific code into the ot_tcp module to prepare for multiple concurrent workers --- ot_tcp.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ot_tcp.h (limited to 'ot_tcp.h') diff --git a/ot_tcp.h b/ot_tcp.h new file mode 100644 index 0000000..b0a93f4 --- /dev/null +++ b/ot_tcp.h @@ -0,0 +1,22 @@ +/* This software was written by Dirk Engling + It is considered beerware. Prost. Skol. Cheers or whatever. + + $id$ */ + +#ifndef OT_TCP_H__ +#define OT_TCP_H__ + +#include + +#include "trackerlogic.h" + +/* Take whatever connections are waiting on a listening socket and answer + them, each on this thread's stack, handing a connection that cannot be + finished to the event loop */ +void tcp_accept(const int64_t serversocket, struct ot_workstruct *ws); + +/* Handler connections in the event loop has become readable or writable */ +void tcp_read(const int64_t sock, struct ot_workstruct *ws); +void tcp_write(const int64_t sock); + +#endif -- cgit v1.3