套接字 中 shutdown与close区别

1. int shutdown ( int s ,  int how )windows how=0 关闭接收端,unix下会刷新输入队列,丢弃在tcp/ip 栈中的应用程序还未读到的数据,若是还有新数据到来,tcp会进行ACK确认,可是数据也仍是会丢弃,反正应用程序将收不到数据,即便已经到达了内核。windows下会重置链接。(套接字 用how=0 shutdown,若是再对他进行读操做,返回EO
相关文章
相关标签/搜索