11 # include <sys/socket.h>
12 # include <netinet/in.h>
15 #define SERVER_PORT 0xACE
23 # define INVALID_SOCKET -1
29 struct sockaddr_in server;
30 struct sockaddr_in client;
33 /* Open windows connection */
34 if (WSAStartup(0x0101, &gWinsock) != 0)
36 fprintf(stderr, "Could not open Windows connection.\n");
41 // Open UDP Connection
42 gSocket = socket(AF_INET, SOCK_DGRAM, 0);
43 if (gSocket == INVALID_SOCKET)
45 fprintf(stderr, "Could not create socket.\n");
53 memset((void *)&server, '\0', sizeof(struct sockaddr_in));
54 server.sin_family = AF_INET;
55 server.sin_port = htons(SERVER_PORT);
56 server.sin_addr.s_addr = htonl(0x7F00001);
59 memset((void *)&client, '\0', sizeof(struct sockaddr_in));
60 client.sin_family = AF_INET;
61 client.sin_port = htons(0);
62 client.sin_addr.s_addr = htonl(0x7F00001);
65 if( bind(gSocket, (struct sockaddr *)&client, sizeof(struct sockaddr_in)) == -1 )
67 fprintf(stderr, "Cannot bind address to socket.\n");
79 int _Syscall(const char *ArgTypes, ...)