Changeset 483 for Daodan/Flatline/src/testclient.c
- Timestamp:
- Nov 29, 2009, 9:20:43 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/Flatline/src/testclient.c
r457 r483 5 5 { 6 6 NetPlatform_Initalize(); 7 int sock = Net _CreateSocket(0);7 int sock = NetUDPSocket_Create(0); 8 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") }; 9 11 10 12 int i; 11 13 for (i = 0; i < 100; i ++) 12 14 { 13 if (Net _Send(sock, inet_addr("127.0.0.1"), 27777, "hi", 3))15 if (NetUDPSocket_Send(sock, (sockaddr*)&address, "hi", 2)) 14 16 putchar('*'); 15 17 else 16 18 putchar('x'); 17 19 } 18 Net _CloseSocket(sock);20 NetUDPSocket_Close(sock); 19 21 NetPlatform_Shutdown(); 20 22 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.