YedFtpPipe - Open_Connection

NAME:
Open_Connection

SYNOPSIS:
SINT Open_Connection(void *pvO);

DESCRIPTION:
The method opens a connection to the FTP server using the user name and password previously set. It performs this connection in this way:

Whenever the parent process sends a string through its socket, the child receives a string in its standard input, as if you are driving '/usr/bin/ftp' application from command prompt. So if you send 'ls -la\n' string to the child, it will perform this command and will sends back to parent the server command answer command, through the pair of connected sockets used as communication channel.
pvO is the instance of the object invoking the method.

RETURN VALUE:
The method returns YFTSUCCESS if a connection to FTP server has been established. In case of error, it returns:

YFTMISSINGHOST
The host name has not been previously initialized.

YFTMISSINGUSER
The user name has not been previously initialized.

YFTMISSINGPASSWD
The password has not been previously initialized.

YFTPIPERR
Can't open the pair of connected sockets. Read errno value for major details.

YFTNOBLOCKERR
Can't set the socket in nonblocking mode. Read errno value for major details.

YFTFORKERR
Can't create a child process. Read errno value for major details.

YFTNOFILEMAN
Can't alloc enough memory for YedFileMan object used in waiting from ftp child instance.

YFTNOSYNC
Timeout error in waiting for the ftp child instance

YFTWRITERROR
Error in writing data to socket

YFTNOREPLY
Timeout error in data reply from child.

In all other cases in that the method receives a bad response code from child, it returns this code. The meaning of these codes is explained in RFC documents about FTP protocol ( RFC 959 and others ).


http://yed.sourceforge.net