aboutsummaryrefslogtreecommitdiffstats
path: root/server/channel.h
blob: 8068a4c90f0f24aa7dc5c67b0a476fd71c42c47c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef KV_SERVER_CHANNEL_H
#define KV_SERVER_CHANNEL_H

#include <kv.h>

#include <netinet/ip.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <rstypes.h>

#include <pthread.h>

/// 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 *);

#endif // KV_SERVER_CHANNEL_H