From The Compiler, 6 Years ago, written in C.
Embed
  1. #include <winsock.h>
  2. #define BUF_SIZE 16
  3.  
  4. int main(void) {
  5.     WSADATA wsaData;
  6.     SOCKET sock;
  7.     SOCKADDR_IN server;
  8.     char buf[BUF_SIZE] = "";
  9.  
  10.     // init
  11.     WSAStartup(MAKEWORD(1, 1), &wsaData);
  12.  
  13.     // socket anlegen
  14.     sock = socket(AF_INET, SOCK_STREAM, 0);
  15.  
  16.     // sockaddr-struct anlegen
  17.     server.sin_family = AF_INET;
  18.     server.sin_port = htons(1337);
  19.     server.sin_addr = inet_addr('94.23.233.17');
  20.  
  21.     // verbindung oeffnen
  22.     connect(sock, (struct sockaddr*)&server, sizeof(server));
  23.    
  24.     // 16 bytes lesen
  25.     recv(sock, &buf, BUF_SIZE, 0);
  26.  
  27.     // cleanup
  28.     closesocket(sock);
  29.     WSACleanup();
  30. }