WSAGetLastError code 183 O?o
hey... my code for binding a socket creates the error code 183 - not listed in the msdn... anyone knows how this could have happened?...
winsock was successfully initialized before the call to bind()...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
addrinfo hints;
addrinfo *servinfo;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_PASSIVE;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_family = AF_INET;
//Get address information
*m_pMM->GetLogger() << "[Retreiving servers address information......";
if(getaddrinfo(NULL,"12345", &hints, &servinfo))
{
*m_pMM->GetLogger() << "Error: getaddrinfo()";
//throw "ERROR";
EWinsockError e;
e.SetError(WSAGetLastError(),"Error: getaddrinfo()");
e.m_InternalErrorCode = EWinsockError::EBINDSOCKET;
throw(e);
}
*m_pMM->GetLogger() << "Done]";
//Bind Socket
*m_pMM->GetLogger() << "Binding Socket...";
if(bind(m_ConSocket, servinfo->ai_addr, sizeof(SOCKADDR)))
{
//Log
*m_pMM->GetLogger() << "Error: bind()";
//Exception
EWinsockError e;
int err = WSAGetLastError(); // for testing purpose: wether it really is 183 or something else may be wrong...
e.SetError(WSAGetLastError(),"Error: bind()");
e.m_InternalErrorCode = EWinsockError::EBINDSOCKET;
throw(e);
}
|
Last edited on
Topic archived. No new replies allowed.