| Line | |
|---|
| 1 |
#include "noit_defines.h" |
|---|
| 2 |
|
|---|
| 3 |
#include <stdio.h> |
|---|
| 4 |
#include <stdlib.h> |
|---|
| 5 |
#include <errno.h> |
|---|
| 6 |
#include <sys/ioctl.h> |
|---|
| 7 |
#include <fcntl.h> |
|---|
| 8 |
|
|---|
| 9 |
#include "eventer/eventer.h" |
|---|
| 10 |
#include "utils/noit_log.h" |
|---|
| 11 |
#include "noit_listener.h" |
|---|
| 12 |
#include "noit_console.h" |
|---|
| 13 |
|
|---|
| 14 |
int main(int argc, char **argv) { |
|---|
| 15 |
|
|---|
| 16 |
noit_log_init(); |
|---|
| 17 |
noit_log_stream_add_stream(noit_debug, noit_stderr); |
|---|
| 18 |
noit_log_stream_add_stream(noit_error, noit_stderr); |
|---|
| 19 |
|
|---|
| 20 |
if(eventer_choose("kqueue") == -1) { |
|---|
| 21 |
fprintf(stderr, "Cannot choose kqueue\n"); |
|---|
| 22 |
exit(-1); |
|---|
| 23 |
} |
|---|
| 24 |
if(eventer_init() == -1) { |
|---|
| 25 |
fprintf(stderr, "Cannot init kqueue\n"); |
|---|
| 26 |
exit(-1); |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
noit_listener("127.0.0.1", 23123, SOCK_STREAM, 5, noit_console_handler, NULL); |
|---|
| 30 |
eventer_loop(); |
|---|
| 31 |
return 0; |
|---|
| 32 |
} |
|---|