d116.bmp.txt

来自「Visual C++通信编程工程实例精解(附盘)」· 文本 代码 · 共 44 行

TXT
44
字号
               case WSAEISCONN:
                                     result_"The socket is already connected.";
  break;
               case WSAEMFILE:
                       result="No more ffle descriptors are available";
  break;
               case WSAENETUNREACH:
                             result="The network cannot be reached from this host at this time";
  break;
               case WSAENOBUFS:
                                result="No buffer space is available. The socket cannot be connected";
  break;
               case WSAENOTSOCK:
                                     result="The descnptor is not a socket";
  break;
                case WSAETIMEDOUT:
                             result="Attempt to connect timed out without establishing a connection";
  break;
                case WSAEWOULDBLOCK:
              result="The socket is marked as nonblocking and the connection cannot be completed
immediately. ";
  break;
 default:
                        result="unknown error";
                    }
                retum result,
11)瀑加CChatClient类接收连接函数OnReceive()。
l/6
void CChatCl:ient::OnReceive(int nErrorCode)
{
               // TODO: Add your specialized code here and/or call the base class
CSocket::OnReceive(nErrorCode);
do
 {
        CMessg temp;
                               temp. S erialize(*m_aS es sionln);
m_dlg->m_sMsgList+=temp.m_strText;
m_dlg->SetDlgltemText(IDC_SHOWMSG,m_dlg->m_sMsgList);
             int linenum=《CEdit *)(m_dlg->GetDlgItem(IDC_SHOWMSG》)->GetLineCount0;
《CEdit *)(m_dlg->GetDlgltem(IDC_SHOWMSG》)->LineScroll(linenum);
               if( !m_dlg->m_bClient)
           {
                              for(POSITION pos=m_dlg->m.  connectionList.GetHeadPosition();pos !=NULL;)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?