示例#1
0
void BailOnSocketError( const char* context )
{
#ifdef WIN32

	int e = WSAGetLastError();
	const char* msg = GetWinsockErrorString( e );
#else
	const char* msg = strerror( errno );
#endif
	throw Wobbly( "%s: %s", context, msg );
}
示例#2
0
// ----------------------------------------------------------------------
void
SocketNs3::
BailOnSocketError(std::string context)
const throw(SocketException)
{
#ifdef WIN32
    int e = WSAGetLastError();
    std::string msg = GetWinsockErrorString(e);
#else
    std::string msg = strerror(errno);
#endif
    throw SocketException(context + ": " + msg);
}