YedFtpPipe - Open_Connection
SINT Open_Connection(void *pvO);
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.
The method returns YFTSUCCESS if a connection to FTP server has been established. In case of error, it returns:
The host name has not been previously initialized.
The user name has not been previously initialized.
The password has not been previously initialized.
Can't open the pair of connected sockets. Read errno value for major details.
Can't set the socket in nonblocking mode. Read errno value for major details.
Can't create a child process. Read errno value for major details.
Can't alloc enough memory for YedFileMan object used in waiting from ftp child instance.
Timeout error in waiting for the ftp child instance
Error in writing data to socket
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 ).