static void release_modem(struct IsdnCardState *cs) { cs->hw.elsa.MFlag = 0; if (cs->hw.elsa.transbuf) { if (cs->hw.elsa.rcvbuf) { mshutdown(cs); kfree(cs->hw.elsa.rcvbuf); cs->hw.elsa.rcvbuf = NULL; } kfree(cs->hw.elsa.transbuf); cs->hw.elsa.transbuf = NULL; } }
int ServerMain(LPVOID pointerToObject) { minitialize(); AllocConsole() ; AttachConsole( GetCurrentProcessId() ) ; freopen( "CON", "w", stdout ) ; // Accept a client socket for (int sock=1; sock<1000; sock++) { ClientSocket = accept(ListenSocket, NULL, NULL); char sockprint[80]; char sockchar[4]; itoa(sock,sockchar,10); strcpy(sockprint,"Client "); strcat(sockprint,sockchar); strcat(sockprint," connected."); printm(sockprint); GoToXY(0,23); if (ClientSocket == INVALID_SOCKET) { std::cout<<"accept failed with error: "<<WSAGetLastError()<<"\n"; closesocket(ClientSocket); WSACleanup(); minitialize(); } client[sock].cs=ClientSocket; client[sock].con=true; client[sock].i=clientnumber; client[sock].client=sock; lastclient=clientnumber; hRecvThread = CreateThread(NULL,0,recvfunc,pointerToObject,0,&dwRecvThreadId); clientnumber++; currentclient=clientnumber; } while(true) { Sleep(1000000); } // shutdown the connection since we're done mshutdown(); return 0; }