WSAGetLastError returns 0
I have the following code:
Code:
void CUSimCtrlDlg::initializeSockets()
{
int status = 0;
// Start Winsock Version 1.1 DLL
WSAStartup ( MAKEWORD ( 1,1 ), &wsaData );
// Setup Socket to Rx all messages
m_rx_pulse_socket = socket(AF_INET,SOCK_DGRAM,INADDR_ANY);
sAddrRxAll.sin_family = AF_INET;
sAddrRxAll.sin_addr.s_addr = htonl ( INADDR_ANY );
sAddrRxAll.sin_port = htons ( PORT_NUM_RX_FROM_HOST );
status = bind ( m_rx_pulse_socket, (SOCKADDR FAR *)&sAddrRxAll, sizeof ( SOCKADDR_IN ) );
if (status == SOCKET_ERROR)
{
AfxMessageBox("Socket Error");
OnButtonExit();
}
m_tx_pulse_socket = socket(AF_INET,SOCK_DGRAM,INADDR_ANY);
sAddrTxAll.sin_family = AF_INET;
sAddrTxAll.sin_addr.s_addr = htonl ( INADDR_ANY );
sAddrTxAll.sin_port = htons ( PORT_NUM_TX_TO_HOST );
bind ( m_rx_pulse_socket, (SOCKADDR FAR *)&sAddrTxAll, sizeof ( SOCKADDR_IN ) );
I was wondering why the last Bind(...) was not assigned into a status as the first one was. So I added the code status = to the bind(...) and the status did return a SOCKET_ERROR (-1)
So I called WSAGetLastError() and the return was 0. What does this mean? I could not find any corresponding error for value of 0.
Thanks