summaryrefslogtreecommitdiff
path: root/toxcore/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/network.h')
-rw-r--r--toxcore/network.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/toxcore/network.h b/toxcore/network.h
index 32850944..3a1c75f8 100644
--- a/toxcore/network.h
+++ b/toxcore/network.h
@@ -120,7 +120,12 @@ typedef struct {
120typedef struct { 120typedef struct {
121 Packet_Handles packethandlers[256]; 121 Packet_Handles packethandlers[256];
122 /* Our UDP socket. */ 122 /* Our UDP socket. */
123#ifdef WIN32
124 unsigned int sock;
125#else
123 int sock; 126 int sock;
127#endif
128
124} Networking_Core; 129} Networking_Core;
125 130
126/* return current time in milleseconds since the epoch. */ 131/* return current time in milleseconds since the epoch. */
@@ -134,7 +139,12 @@ uint32_t random_int(void);
134/* Basic network functions: */ 139/* Basic network functions: */
135 140
136/* Function to send packet(data) of length length to ip_port. */ 141/* Function to send packet(data) of length length to ip_port. */
142#ifdef WIN32
143int sendpacket(unsigned int sock, IP_Port ip_port, uint8_t *data, uint32_t length);
144#else
137int sendpacket(int sock, IP_Port ip_port, uint8_t *data, uint32_t length); 145int sendpacket(int sock, IP_Port ip_port, uint8_t *data, uint32_t length);
146#endif
147
138 148
139/* Function to call when packet beginning with byte is received. */ 149/* Function to call when packet beginning with byte is received. */
140void networking_registerhandler(Networking_Core *net, uint8_t byte, packet_handler_callback cb, void *object); 150void networking_registerhandler(Networking_Core *net, uint8_t byte, packet_handler_callback cb, void *object);