Socket 10054

客户端经常不定时地出现错误号为:10054的错误,而服务器端并没有相应的提示。这个问题出现得比较莫名其妙。

 

查了MSDN上的10054错误号说明:WSAECONNRESET     (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.)

 

 也就是说,一个连接被对方重设。一个建立的连接被远程主机强行关闭,若远程主机上的进程异常终止运行(由于内存冲突或硬件故障),或者针对套接字执行了一次强行关闭,便会产生10054错误。针对强行关闭的情况,可用SO_LINGER套接字选项和setsockopt来配置一个套接字。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值