summaryrefslogtreecommitdiff
path: root/testing/Lossless_UDP_testserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/Lossless_UDP_testserver.c')
-rw-r--r--testing/Lossless_UDP_testserver.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/testing/Lossless_UDP_testserver.c b/testing/Lossless_UDP_testserver.c
index f4b144b4..bc4fed7a 100644
--- a/testing/Lossless_UDP_testserver.c
+++ b/testing/Lossless_UDP_testserver.c
@@ -117,20 +117,22 @@ void printconnection(int connection_id)
117 * run doLossless_UDP(); */ 117 * run doLossless_UDP(); */
118void Lossless_UDP() 118void Lossless_UDP()
119{ 119{
120 IP_Port ip_port; 120// IP_Port ip_port;
121 uint8_t data[MAX_UDP_PACKET_SIZE]; 121// uint8_t data[MAX_UDP_PACKET_SIZE];
122 uint32_t length; 122// uint32_t length;
123 while (receivepacket(&ip_port, data, &length) != -1) { 123// while (receivepacket(&ip_port, data, &length) != -1) {
124 //if(rand() % 3 != 1)//add packet loss 124 //if(rand() % 3 != 1)//add packet loss
125 //{ 125 //{
126 if (LosslessUDP_handlepacket(data, length, ip_port)) { 126// if (LosslessUDP_handlepacket(data, length, ip_port)) {
127 printpacket(data, length, ip_port); 127// printpacket(data, length, ip_port);
128 } else { 128// } else {
129 //printconnection(0); 129 //printconnection(0);
130 printf("Received handled packet with length: %u\n", length); 130// printf("Received handled packet with length: %u\n", length);
131 } 131// }
132 //} 132 //}
133 } 133// }
134
135 networking_poll();
134 136
135 doLossless_UDP(); 137 doLossless_UDP();
136} 138}
@@ -161,6 +163,7 @@ int main(int argc, char *argv[])
161 int connection; 163 int connection;
162 uint64_t timer = current_time(); 164 uint64_t timer = current_time();
163 165
166 LosslessUDP_init();
164 167
165 while (1) { 168 while (1) {
166 Lossless_UDP(); 169 Lossless_UDP();