summaryrefslogtreecommitdiffstats
path: root/socket.h
blob: e34bf2c4a09a437cd2a17bc3a6ae553845d9aeba (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
28
29
30
31
32
33
34
35
//
//  main.h
//  mcc@exe
//
//  Created by Finn Behrens on 19.02.21.
//

#ifndef socket_h
#define socket_h

/* Libevent. */
#include <event2/event.h>
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/event_struct.h>


#include "parser.h"

extern struct event_base *evbase;


/**
 * Set a socket to non-blocking mode.
 */
int
setnonblock(int fd);

/**
 * create events and open socket
 */
int open_socket(int port);


#endif /* socket_h */