class ftp_client_pipe_t

Module to handle the networking calls for the client side of the FTP protocol.

Inheritance:


Public Methods

[more]void init(ftp_client_pipe_datainterface_t* datainterface, Sked* sked, int max_bytes_per_sec, Poller* poller, struct sockaddr_in* local_addr)
Initialize this object, and mark it as not connected.
[more]int shutdown()
Call this when done with the session.
[more]int notifyPollEvent(Poller::PollEvent* event)
The operating system has told us that one of our file descriptors is ready for I/O.
[more]int getStatus(char* buf, size_t buflen)
Get the status of the last login, quit, cd, ls, or get call.
[more]int login(const char* username, const char* password)
Log in to the server.
[more]int quit()
Log out from the server.
[more]int cd(const char* dir)
Change directories.
[more]int type(const char* ttype)
Setting transfer type.
[more]int size(const char* fname)
Retrieve file size.
[more]int ls(const char* dirname, bool passive)
List the given directory's contents.
[more]int get(const char* fname, bool passive)
Retrieve the given file's contents.


Inherited from Client:


Documentation

Module to handle the networking calls for the client side of the FTP protocol. Delegates the work of parsing and generating messages to the ftp_client_protocol module.
ovoid init(ftp_client_pipe_datainterface_t* datainterface, Sked* sked, int max_bytes_per_sec, Poller* poller, struct sockaddr_in* local_addr)
Initialize this object, and mark it as not connected. The calling object should implement the ftp_client_pipe_datainterface_t interface and pass a pointer to itself. The remining arguments are a pointer to the shared global scheduler, and the maximum bytes per second to allow this client. After each call to handle_data_read(), this module will use the scheduler to sleep long enough to stay under the specified bandwidth.
Parameters:
local_addr - if not 0, local_addr specifies the local IP address to use for the local side of the connection. Must be stable pointer.

oint shutdown()
Call this when done with the session. Closes the file descriptors. Returns 0 on success, else unix error code.

oint notifyPollEvent(Poller::PollEvent* event)
The operating system has told us that one of our file descriptors is ready for I/O. Deal with it.

Returns 0 on success, Unix error code on failure. If this returns an error, call shutdown() to close this session.

This is normally called by the app after a call to poll() or sigtimedwait(), or internally by skedCallback().

oint getStatus(char* buf, size_t buflen)
Get the status of the last login, quit, cd, ls, or get call. If the operation is still in progress, returns 0. If the operation has succeeded, returns a value between 200 and 299. ASCII version of result is returned in given buffer, if buf != NULL.

oint login(const char* username, const char* password)
Log in to the server. datainterface->ftpCmdDone() will be called when done.

oint quit()
Log out from the server. This triggers the QUIT command. datainterface->ftpCmdDone() will be called when done.

oint cd(const char* dir)
Change directories. If dir is "..", the CDUP command is used instead of CD. datainterface->ftpCmdDone() will be called when done.

oint type(const char* ttype)
Setting transfer type. datainterface->ftpCmdDone() will be called when done.

oint size(const char* fname)
Retrieve file size. datainterface->ftpCmdDone() will be called when done; the size of the file can be parsed out of the third parameter.

oint ls(const char* dirname, bool passive)
List the given directory's contents. If dirname is NULL, the current directory is listed. If passive is true, PASV mode is used, else PORT mode is used. datainterface->ftpCmdDone() will be called when done.

oint get(const char* fname, bool passive)
Retrieve the given file's contents. If passive is true, PASV mode is used, else PORT mode is used. datainterface->ftpCmdDone() will be called when done.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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