source: Daodan/MSVC/testclient.c@ 757

Last change on this file since 757 was 567, checked in by gumby, 14 years ago

Daodan MSVC

File size: 589 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 char buffer[256] = {0};
13 fgets(buffer, 256, stdin);
14
15
16 int i;
17 for (i = 0; i < 10; i ++)
18 {
19 if (NetUDPSocket_Send(sock, (sockaddr*)&address, buffer, 256))
20 putchar('*');
21 else
22 putchar('x');
23 }
24 NetUDPSocket_Close(sock);
25 NetPlatform_Shutdown();
26 return 0;
27}
Note: See TracBrowser for help on using the repository browser.