libssh2
1.\" Copyright (C) The libssh2 project and its contributors.
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_channel_close 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
4.SH NAME
5libssh2_channel_close - close a channel
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10int
11libssh2_channel_close(LIBSSH2_CHANNEL *channel);
12.fi
13.SH DESCRIPTION
14\fIchannel\fP - active channel stream to set closed status on.
15
16Close an active data channel. In practice this means sending an SSH_MSG_CLOSE
17packet to the remote host which serves as instruction that no further data
18will be sent to it. The remote host may still send data back until it sends
19its own close message in response. To wait for the remote end to close its
20connection as well, follow this command with
21.BR libssh2_channel_wait_closed(3)
22.SH RETURN VALUE
23Return 0 on success or negative on failure. It returns
24LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
25LIBSSH2_ERROR_EAGAIN is a negative number, it is not really a failure per se.
26.SH ERRORS
27\fILIBSSH2_ERROR_SOCKET_SEND\fP - Unable to send data on socket.
28.SH SEE ALSO
29.BR libssh2_channel_open_ex(3)
30