Show
Ignore:
Timestamp:
2006-02-06 22:39:20 (5 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
convert_revision:
svn:778c30c8-61e0-0310-89d4-fe2f97a467b2/trunk@506
Message:
Added an optional parameter `also_files` to `FTPHost.keep_alive`
and documented it in `ftputil.txt`.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ftputil.txt

    r485 r487  
    654654  and use of remote file-like objects. 
    655655 
    656 - ``keep_alive()`` 
     656.. _`FTPHost.keep_alive`: 
     657 
     658- ``keep_alive(also_files=True)`` 
    657659 
    658660  Do something without side effects to hold the connection to the FTP 
    659661  server. This should be used to prevent server timeouts after several 
    660662  minutes of inactivity. 
     663 
     664  Note that not only an ``FTPHost`` object but also *each* of the 
     665  file-objects made from it has its own connection to the FTP server, 
     666  so all of the connections must be kept alive. Use the default 
     667  setting, ``True``, for ``also_files`` to propagate the refresh to 
     668  all open file-like objects made from this ``FTPHost`` instance. 
     669 
     670  However, be careful with the default parameter in multi-threaded 
     671  applications. 
    661672 
    662673 
     
    711722  server. This should be used to prevent server timeouts after several 
    712723  minutes of inactivity. 
     724 
     725  Note that not only an ``FTPHost`` object but also *each* of the 
     726  file-objects made from it has its own connection to the FTP server, 
     727  so all of the connections must be kept alive. Use the 
     728  `FTPHost.keep_alive`_ to refresh all connections at once. 
    713729 
    714730 
     
    816832- Timeouts of individual child sessions currently are not handled. 
    817833  This is only a problem if your ``FTPHost`` object or the generated 
    818   ``FTPFile`` objects are inactive for about ten minutes or longer. A 
    819   workaround is to keep the respective connections busy, e. g. call 
    820   ``getcwd`` on ``FTPHost`` objects or ``write("")`` on remote 
    821   file-like objects. 
     834  ``FTPFile`` objects are inactive for about ten minutes or longer. 
     835  As a workaround, you can use the ``keep_alive`` methods of 
     836  ``FTPHost`` objects and remote file-like objects. 
    822837 
    823838- Until now, I haven't paid attention to thread safety. In principle,