[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FTPAPI FTP_exitproc



   Dear Group.


   I have some problems getting the FTP_exitproc working across FTP
   session within the same 5250 session.


   Having:

   (1)          FTP_exitProc( FTP_DEFAULT_SOCKET   : FTP_EXTLOG   :
   %paddr(FTPExitProc) : %addr(LastMsg) );

   (1)          FtpSess =
   FTP_Conn(FtpRmtSys:FtpUsr:FtpPwd:FTPPort:FTPCnnTio);


   Starting the  FTP_exitproc with FTP_DEFAULT_SOCKET before FTP_conn is
   for getting the connection message from the FTP server

                   Connecting to host xxx.xxx.xxx.xxx at address
   xxx.xxx.xxx.xxx using port 21.

                   220 <<<Connect:Enterprise UNIX 2.4.04 Build 134 >>> at
   espdev01 FTP server ready. Time = 07:19:29

                   > USER
   yyyyyyyy

                   331 Password required for
   yyyyyyyy

                   > PASS
   **********

                   230 Connect:Enterprise UNIX login ok, access
   restrictions apply.


   this would be missing if I used

   (2)          FtpSess =
   FTP_Conn(FtpRmtSys:FtpUsr:FtpPwd:FTPPort:FTPCnnTio);

   (2)          FTP_exitProc( FtpSess   :  FTP_EXTLOG    :
   %paddr(FTPExitProc) : %addr(LastMsg) );


   Now the problem:


   Calling MyFTPPgmA

   Using (1) causes problems if the FTP_Conn for some reason (server not
   available, invalid pw etc.)  fails.

   The FTP_exitporoc is set at this time and does not get 'cleared'.

   I think this is because I can't do a FTP_Quit since the session isn't
   established.


   Calling MyFTPPgmB

   While still in the same 5250 session I call a different program using
   the same setup (1) and connecting to another FTP server.

   MyFTPPgmB crashes when doing the FTP_Conn. Reason is the FTP_exitproc
   still pointing to the routine set by MyFTPPgmA.

   The FTPExitProc in MyFTPPgmA writes to a file  A and  this routine
   still is in effect when running MyFTPPgmB.

   The required file A isn't open since MyFTPPgmB uses file B, not A..


   To summarize the problem:


   The FTP_exitproc set in one program 'hangs' when not doing a FTP_Quit
   and that's seems not to be possible to do when FTP_Conn fails.


   Hoping for a wise solution.


   Best regards

   Helge
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------