diff options
Diffstat (limited to 'toxcore/TCP_client.h')
-rw-r--r-- | toxcore/TCP_client.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/toxcore/TCP_client.h b/toxcore/TCP_client.h index 21254314..8a698869 100644 --- a/toxcore/TCP_client.h +++ b/toxcore/TCP_client.h | |||
@@ -27,6 +27,12 @@ | |||
27 | #include "TCP_server.h" | 27 | #include "TCP_server.h" |
28 | #include "crypto_core.h" | 28 | #include "crypto_core.h" |
29 | 29 | ||
30 | #ifdef HAVE_LIBEV | ||
31 | #include <ev.h> | ||
32 | #elif HAVE_LIBEVENT | ||
33 | #include <event2/event.h> | ||
34 | #endif | ||
35 | |||
30 | #define TCP_CONNECTION_TIMEOUT 10 | 36 | #define TCP_CONNECTION_TIMEOUT 10 |
31 | 37 | ||
32 | typedef enum { | 38 | typedef enum { |
@@ -52,7 +58,15 @@ enum { | |||
52 | }; | 58 | }; |
53 | typedef struct { | 59 | typedef struct { |
54 | uint8_t status; | 60 | uint8_t status; |
55 | Socket sock; | 61 | Socket sock; |
62 | #ifdef HAVE_LIBEV | ||
63 | struct { | ||
64 | ev_io listener; | ||
65 | struct ev_loop *dispatcher; | ||
66 | } sock_listener; | ||
67 | #elif HAVE_LIBEVENT | ||
68 | struct event *sock_listener; | ||
69 | #endif | ||
56 | uint8_t self_public_key[CRYPTO_PUBLIC_KEY_SIZE]; /* our public key */ | 70 | uint8_t self_public_key[CRYPTO_PUBLIC_KEY_SIZE]; /* our public key */ |
57 | uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE]; /* public key of the server */ | 71 | uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE]; /* public key of the server */ |
58 | IP_Port ip_port; /* The ip and port of the server */ | 72 | IP_Port ip_port; /* The ip and port of the server */ |