18 Sockets [socket]

18.6 Class template basic_socket [socket.basic]

18.6.2 basic_socket destructor [socket.basic.dtor]

~basic_socket();

Effects: If is_open() is true, cancels all outstanding asynchronous operations associated with this socket, disables the linger socket option to prevent the destructor from blocking, and releases socket resources as if by POSIX close(native_handle()). Completion handlers for canceled operations are passed an error code ec such that ec == errc::operation_canceled yields true.