#include <sys/socket.h>
int shutdown(int sockfd, int how)
shutdown():
Communication on a socket is bidirectional. disable I/O on a socket with the shutdown function
(在socket上的操作是双向的,shutdown函数可以关闭在socket的通讯)
how:
可选的参数如下:
SHUT_RD 禁止从sockfd上读取操作
SHUT_WR 禁止往sockfd上写入操作
SHUT_RDWR 禁止sockfd上数据传输和接收的操作
return:
0-ok, -1 - error