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

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

fixed testclient

File size: 526 bytes
Line 
1#include <stdio.h>
2#include "Flatline.h"
3
4int main()
5{
6 NetPlatform_Initalize();
7 int sock = NetUDPSocket_Create(0);
8 puts("Sending 100 two byte packets . . .");
9
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
12 int i;
13 for (i = 0; i < 100; i ++)
14 {
15 if (NetUDPSocket_Send(sock, (sockaddr*)&address, "hi", 2))
16 putchar('*');
17 else
18 putchar('x');
19 }
20 NetUDPSocket_Close(sock);
21 NetPlatform_Shutdown();
22 return 0;
23}
Note: See TracBrowser for help on using the repository browser.