套接字 中 shutdown與close區別

1. int shutdown ( int s ,  int how )windows how=0 關閉接收端,unix下會刷新輸入隊列,丟棄在tcp/ip 棧中的應用程序還未讀到的數據,若是還有新數據到來,tcp會進行ACK確認,可是數據也仍是會丟棄,反正應用程序將收不到數據,即便已經到達了內核。windows下會重置鏈接。(套接字 用how=0 shutdown,若是再對他進行讀操做,返回EO
相關文章
相關標籤/搜索