From 3eeee14d5d5c93ae3d156aabae5a96d1c09f185a Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Thu, 4 Jul 2024 20:49:53 +0300 Subject: Renamed types, migrated to make, changed directory hierarchy --- server/channel.h | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'server/channel.h') diff --git a/server/channel.h b/server/channel.h index 3916212..8068a4c 100644 --- a/server/channel.h +++ b/server/channel.h @@ -3,36 +3,25 @@ #include -#include -#include -#include #include - #include +#include +#include +#include +#include -struct user { - long id; - unsigned int ip; - unsigned short port; - unsigned long last_keepalive; -}; -int __user_cmp(const void* a, const void* b); +#include -struct channel_handle { - int sockfd; - struct user* users; +/// Required for the calling thread to set socket file descriptor +struct thread_loop_arg { + int *sock_dest; + pthread_mutex_t *sock_mx; + pthread_cond_t *sock_ready_cond; + u64 owner; + const unsigned char *pubkey; }; // main function that manages every channel -void thread_loop(void); - -struct channel_handle *channel_init(void); -void channel_uninit(struct channel_handle *handle); - -void send_packets_back(struct kv_packet** packets, struct channel_handle *handle); -void handle_system_packet(struct kv_packet* packet, struct sockaddr_in *source, struct channel_handle* handle); - -void clear_packet_array(struct kv_packet **array); - +void *thread_loop(void *); #endif // KV_SERVER_CHANNEL_H -- cgit v1.2.3-70-g09d2