sftp_async_read_begin

@brief Start an asynchronous read from a file using an opened sftp file handle.

Its goal is to avoid the slowdowns related to the request/response pattern of a synchronous read. To do so, you must call 2 functions:

sftp_async_read_begin() and sftp_async_read().

The first step is to call sftp_async_read_begin(). This function returns a request identifier. The second step is to call sftp_async_read() using the returned identifier.

@param file The opened sftp file handle to be read from.

@param len Size to read in bytes.

@return An identifier corresponding to the sent request, < 0 on error.

@warning When calling this function, the internal offset is updated corresponding to the len parameter.

@warning A call to sftp_async_read_begin() sends a request to the server. When the server answers, libssh allocates memory to store it until sftp_async_read() is called. Not calling sftp_async_read() will lead to memory leaks.

@see sftp_async_read() @see sftp_open()

extern (C)
int
sftp_async_read_begin

Meta