socketException之broken pipe

周末在做数据库迁移时,DBA在插数据到某个大表时,锁表导致应用程序报“Broken pipe”的错误

 

I know that broken pipe error is thrown when the socket on the peer side is closed.

But, in my test I have noted that an immediate 'send' call on this side when the peer side is closed doesn't always lead to a broken pipe error.

After closing the socket on peer side (I have tried clean closing by calling close and also abnormal closing by killing the peer), if I try to send 40 bytes, then I don't get a broken pipe, but, if I try to send 40000 bytes then it immediately gives broken pipe error.

总体来说是因为对端socket已经关闭,导致broken pipe (断开的管道(非正常关闭socket引发的错误))

以下三篇文章介绍的不错

https://blog.csdn.net/wind19/article/details/8049108

https://stackoverflow.com/questions/4584904/what-causes-the-broken-pipe-error 

https://www.cnblogs.com/metoy/p/6565486.html 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值