void myTcpSocket::listenToClient(int totalNumPorts) { try { if (listen(socketId,totalNumPorts) == -1) { #ifdef WINDOWS_XP int errorCode = 0; string errorMsg = "error calling listen():\n"; detectErrorListen(&errorCode,errorMsg); myException* socketListenException = new myException(errorCode,errorMsg); throw socketListenException; #endif #ifdef UNIX myException* unixSocketListenException = new myException(0,"unix: error calling listen()"); throw unixSocketListenException; #endif } } catch(myException* excp) { excp->response(); delete excp; exit(1); } }
void MyTcpSocket::listenToClient(int totalNumPorts) { try { if (listen(m_nSocketId,totalNumPorts) == -1) { #ifdef WINDOWS_XP int errorCode = 0; string errorMsg = "error calling listen():\n"; detectErrorListen(&errorCode,errorMsg); MyException socketListenException(errorCode,errorMsg); throw socketListenException; #endif #ifdef UNIX MyException unixSocketListenException(0,"unix: error calling listen()"); throw unixSocketListenException; #endif } } catch(MyException& excp) { excp.response(); exit(1); } }