123456789101112131415161718192021222324252627282930313233343536373839
NetworkManager::NetworkManager(unsigned short serverPort) { run = 1; run = createSocket(); sockaddr_in sockAddr; sockAddr.sin_family = AF_INET; sockAddr.sin_port = htons(serverPort); sockAddr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1"); run = connectToServer(sockAddr); //Start Thread unsigned int* threadID; _beginthreadex(NULL, 0, threadfunc, 0, 0, threadID); } .... unsigned __stdcall NetworkManager::threadfunc(void * param) { //Gotta Put Code Here cleanUp(); return 0; }