關於GetSockName()的問題。
為什麼顯示如下﹕
ip: 002f463c // 不應是a dotted number IP address馬﹖
Port : 7615
代碼﹕
if (!AfxSocketInit())
{
cerr << _T("Fatal Error: Socket initialization failed") << endl;
return -1;
}
CSocket socket,
oConnectSocket;
CString strName;
UINT nPort;
socket.Create(5000);
socket.Listen(5);
socket.Accept((CAsyncSocket&) oConnectSocket);
oConnectSocket.GetSockName(strName, nPort);
cout << "Client has been connected." << endl;
cout << "IP:" << strName << endl;
cout << "Port" << nPort << endl;