class CClientSock : public CSocket
{
public:
CClientSock();
virtual ~CClientSock();
};
class CSrvsock : public CSocket
{
public:
CSrvsock();
virtual ~CSrvsock();
};
为什么要弄2个呢,只是为了名字区别下吗?好读懂点吗

解决方案 »

  1.   

    一个是用来进行 服务器Listen的,另一个是用来 进行 客户端 Connect的
      

  2.   

    一个服务器,一个客启端,相互分离。异步SOCKET必须要从CSocket派生一个新类,因为异步时下面的这些函数要重写:
    OnAccept
     Notifies a listening socket that it can accept pending connection requests by calling Accept.
     
    OnClose
     Notifies a socket that the socket connected to it has closed.
     
    OnConnect
     Notifies a connecting socket that the connection attempt is complete, whether successfully or in error.
     
    OnOutOfBandData
     Notifies a receiving socket that there is out-of-band data to be read on the socket, usually an urgent message.
     
    OnReceive
     Notifies a listening socket that there is data to be retrieved by calling Receive.
     
    OnSend
     Notifies a socket that it can send data by calling Send.
     
      

  3.   

    如果只有这样可以只用两个啊
    但是你要是有扩展就得弄两个了
    客户端和服务器的socket肯定要有不同的成员属性吧
    所以为了可扩展性好,还是用两个好吧