Do not use a power of two as test packet size as other values give more interesting results.

This commit is contained in:
Oliver Schmidt 2015-08-11 14:18:52 +02:00
parent 392b42888c
commit 45479c7ba1
3 changed files with 19 additions and 19 deletions

View File

@ -99,14 +99,14 @@ void main(void)
{
unsigned i;
len = 512;
len = 500;
for (i = 0; i < len; ++i)
{
buf[i] = i;
}
if (tcp == INVALID_SOCKET)
{
printf("Send Len $%04X To %s", len, inet_ntoa(remote.sin_addr));
printf("Send Len %d To %s", len, inet_ntoa(remote.sin_addr));
if (sendto(udp, buf, len, 0, (SOCKADDR *)&remote, sizeof(remote)) == SOCKET_ERROR)
{
return;
@ -114,7 +114,7 @@ void main(void)
}
else
{
printf("Send Len $%04X", len);
printf("Send Len %d", len);
if (send(tcp, buf, len, 0) == SOCKET_ERROR)
{
return;
@ -135,7 +135,7 @@ void main(void)
}
else if (len)
{
printf("Recv Len $%04X From %s", len, inet_ntoa(remote.sin_addr));
printf("Recv Len %d From %s", len, inet_ntoa(remote.sin_addr));
dump(buf, len);
}
@ -174,7 +174,7 @@ void main(void)
}
else if (len)
{
printf("Recv Len $%04X", len);
printf("Recv Len %d", len);
dump(buf, len);
}
else

View File

@ -21,7 +21,7 @@ struct
}
parms =
{
{192, 168, 0, 2},
{192, 168, 0, 2}, // IP addr of machine running w5100_peer.c
{192, 168, 0, 123},
{255, 255, 255, 0},
{192, 168, 0, 1}
@ -64,8 +64,8 @@ void main(void)
{
unsigned i;
len = 512;
printf("Send Len $%04X", len);
len = 500;
printf("Send Len %d", len);
while (!w5100_send_init(len))
{
printf("!");
@ -88,7 +88,7 @@ void main(void)
{
unsigned i;
printf("Recv Len $%04X", len);
printf("Recv Len %d", len);
for (i = 0; i < len; ++i)
{
if ((i % 24) == 0)

View File

@ -20,7 +20,7 @@ struct
}
parms =
{
{192, 168, 0, 2},
{192, 168, 0, 2}, // IP addr of machine running w5100_peer.c
{192, 168, 0, 123},
{255, 255, 255, 0},
{192, 168, 0, 1}
@ -52,8 +52,8 @@ void main(void)
{
unsigned i;
len = 512;
printf("Send Len $%04X To %d.%d.%d.%d", len, parms.serverip[0],
len = 500;
printf("Send Len %d To %d.%d.%d.%d", len, parms.serverip[0],
parms.serverip[1],
parms.serverip[2],
parms.serverip[3]);
@ -74,7 +74,7 @@ void main(void)
{
unsigned i;
printf("Recv Len $%04X From %d.%d.%d.%d", len, parms.serverip[0],
printf("Recv Len %d From %d.%d.%d.%d", len, parms.serverip[0],
parms.serverip[1],
parms.serverip[2],
parms.serverip[3]);