title: Keeping FTP control connection alive
body: <p>A while back I asked a question regarding keeping the control connection on an FTP session alive during a large transfer.  Although I though I had success after <a href="https://stackoverflow.com/questions/5269012/using-threading-to-keep-ftp-control-port-alive">implementing a solution for a question I'd already asked</a>, it appears as though the ISP is the problem, i.e. they are causing my control connections to die during large transfers.</p>
  
  <p>Interestingly, the old-school FTP client program "Leap-FTP" gets around this issue by just sending 'NOOP' commands to the server on the control connection during a download.  While other popular clients die during transfers (Filezilla, my Python FTP script), LeapFTP runs strong due to this workaround.</p>
  
  <p>I've done some research into threading and Queue, but am having trouble coming up with the code to make this happen.</p>
  
  <p>The solution seems simple enough (in my head, at least): initiate a download, while that download function runs, send a NOOP command every n seconds.  Stop sending the NOOP command after the download function completes.</p>
  
  <p>I'm hoping that someone can give me a suggestion as to how this might be done.  Will it involve the use of threading, Queue, or is there a more simple solution?  </p>
  
  <p>Bottom line is, after a lot of testing, the 'NOOP' command is going to have to be sent during the large downloads (which take place on high-numbered TCP ports).</p>
  
  <p>Thanks!</p>