summaryrefslogtreecommitdiffstats
path: root/server/conn.h
blob: f698054b39fd7e0c330825d26879e0bbf10e20e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef CONN_H
#define CONN_H

#include <ev.h>
#include <lua.h>

#ifndef MSG_MAX_SIZE
#define MSG_MAX_SIZE 16386
#endif

struct conn {
        struct ev_io io;
        struct ev_timer timeout;
        size_t num_read;
	lua_State *L;
	char msg[MSG_MAX_SIZE];
};

int conn_init(struct ev_loop *loop, const char *socket_path);

#endif