第一次使用WinSocket编程,发现一个古怪的异常

第一次使用WinSocket编程,发现一个古怪的错误
因为是很简单程序,基本上是和示例代码一样的。在本地非常正常。但是和朋友在网络上试验就不正常了。大约等待了20秒我这边(服务器端)显示连接上了(我在武汉对方在上海……)对方(客户端)没有反映,然后我这边发送,接受都是10054错误,是什么原因呢?客户端服务器端都是控制台程序,没有载入WIndow.h头文件。

------解决方案--------------------
1054 是WSAECONNRESET错误

An 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, the host or remote network interface is disabled, or the remote host uses 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.
------解决方案--------------------
网络程序还是推荐用wireshark来调试,具体是什么错误一看就知道了
------解决方案--------------------
没有公网IP
怎么连接?NAT无法穿透的关系,正常