Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   shutdown.3p    ( 3 )

выключить операции отправки и получения сокета (shut down socket send and receive operations)

Пролог (Prolog)

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.


Имя (Name)

shutdown — shut down socket send and receive operations


Синопсис (Synopsis)

#include <sys/socket.h>

int shutdown(int socket, int how);


Описание (Description)

The shutdown() function shall cause all or part of a full-duplex connection on the socket associated with the file descriptor socket to be shut down.

The shutdown() function takes the following arguments:

socket Specifies the file descriptor of the socket.

how Specifies the type of shutdown. The values are as follows:

SHUT_RD Disables further receive operations.

SHUT_WR Disables further send operations.

SHUT_RDWR Disables further send and receive operations.

The shutdown() function disables subsequent send and/or receive operations on a socket, depending on the value of the how argument.


Возвращаемое значение (Return value)

Upon successful completion, shutdown() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.


Ошибки (Error)

The shutdown() function shall fail if:

EBADF The socket argument is not a valid file descriptor.

EINVAL The how argument is invalid.

ENOTCONN The socket is not connected.

ENOTSOCK The socket argument does not refer to a socket.

The shutdown() function may fail if:

ENOBUFS Insufficient resources were available in the system to perform the operation.

The following sections are informative.


Примеры (Examples)

None.

Использование в приложениях (Application usage)

None.


Обоснование (Rationale)

None.


Будущие направления (Future directions)

None.


Смотри также (See also)

getsockopt(3p), pselect(3p), read(3p), recv(3p), recvfrom(3p), recvmsg(3p), send(3p), sendto(3p), setsockopt(3p), socket(3p), write(3p)

The Base Definitions volume of POSIX.1‐2017, sys_socket.h(0p)