diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/network.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/network.c b/core/network.c index a20b02f6..bbc1f570 100644 --- a/core/network.c +++ b/core/network.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "network.h" | 25 | #include "network.h" |
26 | 26 | ||
27 | 27 | ||
28 | //returns current time in milleseconds since the epoch. | 28 | //returns current time in milliseconds since the epoch. |
29 | uint64_t current_time() | 29 | uint64_t current_time() |
30 | { | 30 | { |
31 | uint64_t time; | 31 | uint64_t time; |
@@ -62,7 +62,7 @@ int sendpacket(IP_Port ip_port, char * data, uint32_t length) | |||
62 | 62 | ||
63 | } | 63 | } |
64 | 64 | ||
65 | //Function to recieve data, ip and port of sender is put into ip_port | 65 | //Function to receive data, ip and port of sender is put into ip_port |
66 | //the packet data into data | 66 | //the packet data into data |
67 | //the packet length into length. | 67 | //the packet length into length. |
68 | //dump all empty packets. | 68 | //dump all empty packets. |
@@ -73,7 +73,7 @@ int recievepacket(IP_Port * ip_port, char * data, uint32_t * length) | |||
73 | (*(int *)length) = recvfrom(sock, data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen); | 73 | (*(int *)length) = recvfrom(sock, data, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&addr, &addrlen); |
74 | if(*(int *)length <= 0) | 74 | if(*(int *)length <= 0) |
75 | { | 75 | { |
76 | //nothing recieved | 76 | //nothing received |
77 | //or empty packet | 77 | //or empty packet |
78 | return -1; | 78 | return -1; |
79 | } | 79 | } |
@@ -106,7 +106,7 @@ int init_networking(IP ip ,uint16_t port) | |||
106 | //initialize our socket | 106 | //initialize our socket |
107 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); | 107 | sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); |
108 | 108 | ||
109 | //Functions to increase the size of the send and recieve UDP buffers | 109 | //Functions to increase the size of the send and receive UDP buffers |
110 | //NOTE: uncomment if necessary | 110 | //NOTE: uncomment if necessary |
111 | /* | 111 | /* |
112 | int n = 1024 * 1024 * 2; | 112 | int n = 1024 * 1024 * 2; |