What does the read call return on earth if there are already both FIN and RST in the TCP buffer?

徘徊边缘 提交于 2019-12-25 07:24:35

问题


Assuming that the client and server send packets according to the order of sequence as shown in the figure, the client does not know FIN has arrived.

It sends “hello again” to the server, the server responds to the client with an RST and the RST has arrived. Then if the client is blocking on a read, why it return 0 due to the FIN instead of -1 because the RST? In the 《Effective TCP/IP programming》, it tells us that the core will return ECONNRESET error.

My operating system is Ubuntu 12.10. Is it related with the operating system? Please tell me some TCP’s details on this implementation. Thanks in advance.

来源:https://stackoverflow.com/questions/22503882/what-does-the-read-call-return-on-earth-if-there-are-already-both-fin-and-rst-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!