代码如下
CAsyncSocket::OnReceive(nErrorCode)
{
CString RemoteIP;
unsigned int RemotePort;
GetPeerName(RemoteIP,RemotePort);}取到的RemoteIP和RemotePort都是空的
为什么?
CAsyncSocket::OnReceive(nErrorCode)
{
CString RemoteIP;
unsigned int RemotePort;
GetPeerName(RemoteIP,RemotePort);}取到的RemoteIP和RemotePort都是空的
为什么?
在调用
int ReceiveFrom( void* lpBuf, int nBufLen, CString& rSocketAddress, UINT& rSocketPort, int nFlags = 0 );后,相应的返回值就是对方的IP和Port