I'm just playing around with CAsyncSocket in my network consisting of two computers. Here's my code:
success = m_Socket.Create(); //success=1
success = m_Socket.GetSockName(m_SockName,m_PortNumber);
//success=1,m_SockName="0.0.0.0" and m_PortNumber=0x0408
success = m_Socket.Bind(m_PortNumber,"10.0.0.1");
//Fails here, call GetLastError
DWORD error = ::GetLastError();
//error=WSAEINVAL, i.e. socket already bound
My question is - I'm obviously doing things out of sequence. I've tried calling Create with "10.0.0.1" but it fails.
Other info that might be relevant: The program is run on Windows 95 and the other computer in the network has Windows 98.
Thanxs for any help,