我这个程序是实现多个客户端向服务器传数据,以前不能实现同时传送的问题,为了满足我把服务器程序做了修改,但是是在别人以前的程序上修改的,以前用的是Csocket,现在要实现多线程,套接字采用了SOCKET,但客户端还是采用Csocket,这样是不是不行啊,服务器和客户端是不是要对应啊?

解决方案 »

  1.   

    都是TCP协议的,我的客户端发送数据时老是出现WSAECONNRESET错误
      

  2.   

    (10054) 
    Connection reset by peer. 
    A existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, or the remote host used a "hard close" (see setsockopt for more information on the SO_LINGER option on the remote socket.) This error may also result if a connection was broken due to "keep-alive" activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.