source: Daodan/Flatline/src/testclient.c@ 820

Last change on this file since 820 was 483, checked in by rossy, 15 years ago

fixed testclient

File size: 526 bytes
RevLine 
[457]1#include <stdio.h>
2#include "Flatline.h"
3
4int main()
5{
6 NetPlatform_Initalize();
[483]7 int sock = NetUDPSocket_Create(0);
[457]8 puts("Sending 100 two byte packets . . .");
9
[483]10 sockaddr_in address = { .sin_family = AF_INET, .sin_port = htons(27777), .sin_addr.S_un.S_addr = inet_addr("192.168.0.100") };
11
[457]12 int i;
13 for (i = 0; i < 100; i ++)
14 {
[483]15 if (NetUDPSocket_Send(sock, (sockaddr*)&address, "hi", 2))
[457]16 putchar('*');
17 else
18 putchar('x');
19 }
[483]20 NetUDPSocket_Close(sock);
[457]21 NetPlatform_Shutdown();
22 return 0;
23}
Note: See TracBrowser for help on using the repository browser.