7 #define SERVER_PORT 0xACE
18 struct sockaddr_in server;
19 struct sockaddr_in client;
22 /* Open windows connection */
23 if (WSAStartup(0x0101, &gWinsock) != 0)
25 fprintf(stderr, "Could not open Windows connection.\n");
30 // Open UDP Connection
31 gSocket = socket(AF_INET, SOCK_DGRAM, 0);
32 if (gSocket == INVALID_SOCKET)
34 fprintf(stderr, "Could not create socket.\n");
40 memset((void *)&server, '\0', sizeof(struct sockaddr_in));
41 server.sin_family = AF_INET;
42 server.sin_port = htons(SERVER_PORT);
43 server.sin_addr.S_un.S_un_b.s_b1 = (unsigned char)127;
44 server.sin_addr.S_un.S_un_b.s_b2 = (unsigned char)0;
45 server.sin_addr.S_un.S_un_b.s_b3 = (unsigned char)0;
46 server.sin_addr.S_un.S_un_b.s_b4 = (unsigned char)1;
49 memset((void *)&client, '\0', sizeof(struct sockaddr_in));
50 client.sin_family = AF_INET;
51 client.sin_port = htons(0);
52 client.sin_addr.S_un.S_un_b.s_b1 = (unsigned char)127;
53 client.sin_addr.S_un.S_un_b.s_b2 = (unsigned char)0;
54 client.sin_addr.S_un.S_un_b.s_b3 = (unsigned char)0;
55 client.sin_addr.S_un.S_un_b.s_b4 = (unsigned char)1;
58 if( bind(gSocket, (struct sockaddr *)&client, sizeof(struct sockaddr_in)) == -1 )
60 fprintf(stderr, "Cannot bind address to socket.\n");
67 int _Syscall(const char *ArgTypes, ...)