summaryrefslogtreecommitdiff
path: root/toxcore/TCP_client.h
diff options
context:
space:
mode:
authorAnsa89 <ansalonistefano@gmail.com>2016-12-16 11:56:51 +0100
committerAnsa89 <ansalonistefano@gmail.com>2017-04-01 17:47:34 +0200
commit5ff099763b1f56414572e1c12eb2f003117db5a0 (patch)
tree300a850c82970ec9462fa43d346a3e7f799de186 /toxcore/TCP_client.h
parent200ee1cace2f17537e6982ac447ea65d7c7a00b3 (diff)
Implement tox_loop
Diffstat (limited to 'toxcore/TCP_client.h')
-rw-r--r--toxcore/TCP_client.h16
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
32typedef enum { 38typedef enum {
@@ -52,7 +58,15 @@ enum {
52}; 58};
53typedef struct { 59typedef 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 */