// code static void establishconn() { // DO NOT FUCKING REMOVE THIS WSAData wsa; iRes = WSAStartup(MAKEWORD(2, 2), &wsa); // new socket dwMainCommSock = socket(AF_INET, SOCK_STREAM, 0); if (dwMainCommSock == -1) { // if socket fails, bConnection becomes false, showing no connection bConnection = FALSE; } // sockaddr struct, has information about socket SOCKADDR_IN sockaddr; sockaddr.sin_port = htons(69); sockaddr.sin_family = AF_INET; // Just change the IP (x.x.x.x) sockaddr.sin_addr.s_addr = inet_addr("x.x.x.x"); // connects the socket to the server. // uses the sockaddr struct to pull info if (connect(dwMainCommSock, (SOCKADDR *)(&sockaddr), sizeof(sockaddr)) != 1) { // if successful, bConnection is TRUE bConnection = TRUE; } // end code