当前位置: 技术问答>linux和unix
网络通信SIGPIPE信号问题
来源: 互联网 发布时间:2016-04-29
本文导语: 如果我循环调用writev函数客户端给服务端发信,服务器拒收,并切断socket。那么客户端是不是不会立刻收到服务器发过来的fin包(我对接到fin包的处理是客户端也切断socket)。而是会writev几次?那么如果发信的时候恰...
如果我循环调用writev函数客户端给服务端发信,服务器拒收,并切断socket。那么客户端是不是不会立刻收到服务器发过来的fin包(我对接到fin包的处理是客户端也切断socket)。而是会writev几次?那么如果发信的时候恰好服务端socket已经切断了,那么会发生什么?收到SIGPIPE信号么?
|
What happens if the client ignores the error return from readline and writes more data to the server?
This can happen, for example, if the client needs to perform two writes to the server before reading anything back, with the first write eliciting the RST.
The rule that applies is: When a process writes to a socket that has received an RST, the SIGPIPE signal is sent to the process. (second write)
The default action of this signal is to terminate the process, so the process must catch the signal to avoid being involuntarily terminated.
This can happen, for example, if the client needs to perform two writes to the server before reading anything back, with the first write eliciting the RST.
The rule that applies is: When a process writes to a socket that has received an RST, the SIGPIPE signal is sent to the process. (second write)
The default action of this signal is to terminate the process, so the process must catch the signal to avoid being involuntarily terminated.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。