summaryrefslogtreecommitdiff
path: root/testing/Lossless_UDP_testclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/Lossless_UDP_testclient.c')
-rw-r--r--testing/Lossless_UDP_testclient.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/testing/Lossless_UDP_testclient.c b/testing/Lossless_UDP_testclient.c
index 0218de4f..09e9e0a3 100644
--- a/testing/Lossless_UDP_testclient.c
+++ b/testing/Lossless_UDP_testclient.c
@@ -124,25 +124,25 @@ void printconnection(int connection_id)
124/*run doLossless_UDP(); */ 124/*run doLossless_UDP(); */
125//void Lossless_UDP() 125//void Lossless_UDP()
126//{ 126//{
127 /* IP_Port ip_port; 127/* IP_Port ip_port;
128 uint8_t data[MAX_UDP_PACKET_SIZE]; 128 uint8_t data[MAX_UDP_PACKET_SIZE];
129 uint32_t length; 129 uint32_t length;
130 while (receivepacket(&ip_port, data, &length) != -1) { 130 while (receivepacket(&ip_port, data, &length) != -1) {
131 printf("packet with length: %u\n", length); */ 131 printf("packet with length: %u\n", length); */
132 /* if(rand() % 3 != 1)//add packet loss 132/* if(rand() % 3 != 1)//add packet loss
133 { */ 133 { */
134 /* 134/*
135 if (LosslessUDP_handlepacket(data, length, ip_port)) 135 if (LosslessUDP_handlepacket(data, length, ip_port))
136 printpacket(data, length, ip_port); 136 printpacket(data, length, ip_port);
137 else 137 else
138 printf("Received handled packet with length: %u\n", length); //printconnection(0); */ 138 printf("Received handled packet with length: %u\n", length); //printconnection(0); */
139 139
140 /* } */ 140/* } */
141 /* }*/ 141/* }*/
142 142
143 //networking_poll(); 143//networking_poll();
144 144
145 //doLossless_UDP(); 145//doLossless_UDP();
146 146
147//} 147//}
148 148
@@ -166,7 +166,7 @@ int main(int argc, char *argv[])
166 /* bind to ip 0.0.0.0:PORT */ 166 /* bind to ip 0.0.0.0:PORT */
167 IP ip; 167 IP ip;
168 ip.i = 0; 168 ip.i = 0;
169 Lossless_UDP * ludp = new_lossless_udp(new_networking(ip, PORT)); 169 Lossless_UDP *ludp = new_lossless_udp(new_networking(ip, PORT));
170 perror("Initialization"); 170 perror("Initialization");
171 IP_Port serverip; 171 IP_Port serverip;
172 serverip.ip.i = inet_addr(argv[1]); 172 serverip.ip.i = inet_addr(argv[1]);
@@ -203,6 +203,7 @@ int main(int argc, char *argv[])
203 /* printconnection(connection); */ 203 /* printconnection(connection); */
204 networking_poll(ludp->net); 204 networking_poll(ludp->net);
205 do_lossless_udp(ludp); 205 do_lossless_udp(ludp);
206
206 if (is_connected(ludp, connection) == 3) { 207 if (is_connected(ludp, connection) == 3) {
207 208
208 if (write_packet(ludp, connection, buffer, read)) { 209 if (write_packet(ludp, connection, buffer, read)) {