Change throws to asserts. If any of this stuff happens it means a code logic error or a retarded computer, so throwing it is just a waste of time.

This commit is contained in:
mpc
2004-07-01 09:17:17 +00:00
committed by zzz
parent f51e064cf6
commit 2b951e3f61
6 changed files with 71 additions and 106 deletions

View File

@@ -40,7 +40,7 @@ Socket::Socket(int type)
{
#ifdef WINSOCK
winsock_startup();
#endif
}
#ifdef WINSOCK
@@ -49,9 +49,8 @@ Socket::Socket(int type)
*/
void Socket::winsock_cleanup(void)
{
if (WSACleanup() == SOCKET_ERROR)
throw Socket_error("WSACleanup() failed (" +
winsock_strerror(WSAGetLastError()) + ")"); // TODO: log instead
int rc = WSACleanup();
assert(rc != SOCKET_ERROR);
}
/*