summaryrefslogtreecommitdiff
path: root/src/ot_tcp.h
blob: afed142ddf9112862f829385d8cc4da0ee3dbc38 (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
/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
   It is considered beerware. Prost. Skol. Cheers or whatever. */

#ifndef OT_TCP_H__
#define OT_TCP_H__

#include <stdint.h>

#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);

/* One thread accepting on one socket. Called once per worker. */
void tcp_worker_install(int64_t sock);


#endif