d115.bmp.txt
来自「Visual C++通信编程实例」· 文本 代码 · 共 45 行
TXT
45 行
memmove(&inAddr,lpAddr,4);
fO=inAddr.S un.S un b.s bl;
fl=inAddr.S_un.S_un_b.s_b2;
f2=inAddr.S un.S un b.s b3;
f3=inAddr.S_un.S_un_b.s_b4;
}
retum 0;
10)添加CChatClient类错误信息函数ErrorReason()。
CString CChatClient::ErrorReason(int tag)
{
CString result;
switch(tag)
{
case WSANOTINITIALISED:
result="A successful AfxSocketlnit must occur before using this API.";
break;
case WSAENETDOWN:
result="the network subsystem failed";
break;
case WSAEADDRINUSE:
result="The specified address is already in use";
break;
case WSAEINPROGRESS:
result="A blocking Windows Sockets callis in progress";
break;
case WSAEADDRNOTAVAIL:
result="The specified address is not available from the local machine";
break;
case WSAEAFNOSUPPORT:
result="Addresses in the specified family cannot be used with this socket";
break;
case WSAECONNREFUSED:
result="The attempt to connect was rejected";
break;
case WSAEDESTADDRREQ:
result="A destination address is required";
break;
case WSAEFAULT:
result="The nSockAddrLen argument is incorrect";
break;
case WSAEINVAL:
result="lnvalid host address";
break;
//5
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?