class ftp_client_pipe_datainterface_t

Interface that must be implemented by user code to handle FTP data blocks passed to it by this module.

Inheritance:


Public Methods

[more]virtual int handle_data_io(int fd, short revents, clock_t now) = 0
Hook for application-supplied function.
[more]virtual void ftpCmdDone(int xerr, int status, const char* statusbuf) = 0
Hook for application-supplied function.
[more]virtual int getID(void)
Get an integer that identifies this object.


Documentation

Interface that must be implemented by user code to handle FTP data blocks passed to it by this module.

ovirtual int handle_data_io(int fd, short revents, clock_t now) = 0
Hook for application-supplied function. ftp_client_pipe::handle_io() calls this to tell the app to do a chunk of the current file transfer.

Function must issue a single read or write on the fd (as appropriate for the call that triggered the transfer). If read reads zero bytes, or a fatal Unix error, the transfer is over. When the transfer is over, this routine must return '0' without closing the file. If the transfer is not over, this routine must return the number of bytes tranferred during this call, or -1 times the Unix error code caused by read(). The app must not call any ftp_client_pipe_t method inside this callback. On success, returns the number of bytes transferred, or 0 for EOF. On error, returns -1 times the Unix error code. Returning -EWOULDBLOCK will not terminate the transfer.

ovirtual void ftpCmdDone(int xerr, int status, const char* statusbuf) = 0
Hook for application-supplied function. When any command (cd, ls, get, put, ...) finishes, this function is called to alert the app.

If xerr is zero, the local part of the command succeeded; the server's numerical response is in status. The app may call getStatus() to retrieve the text of the server's response. If xerr is nonzero, the local part of the command failed (perhaps a data connection could not be established), and the app should give up on this session (by calling shutdown() and starting over).

The app may call ftp_client_pipe_t methods inside this callback.

ovirtual int getID(void)
Get an integer that identifies this object. Used in log messages.


Direct child classes:
robouser_t
See Also:
ftp_client_pipe_t

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.