<doc>
  <legacy_id>2296</legacy_id>
  <name>libURLSetFTPStopTime</name>
  <type>command</type>
  <syntax>
    <example>libURLSetFTPStopTime <i>timeoutInSeconds</i></example>
  </syntax>
  <library>Internet library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Networks &amp; Communication</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="get">get Command</command>
    <command tag="libURLDownloadToFile">libURLDownloadToFile Command</command>
    <command tag="libURLftpUpload">libURLftpUpload Command</command>
    <command tag="libURLSetFTPMode">libURLSetFTPMode Command</command>
    <command tag="delete URL">delete URL Command</command>
  </references>
  <history>
    <introduced version="1.1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
    <network/>
  </security>
  <summary>Sets the <glossary tag="timeout">timeout</glossary> value for <keyword tag="ftp">FTP</keyword> transfers.</summary>
  <examples>
    <example>libURLSetFTPStopTime 30 <code><i>-- 30-second timeout</i></code></example>
    <example>libURLSetFTPStopTime field "Timeout Value"</example>
  </examples>
  <description>
    <p>Use the <b>libURLSetFTPStopTime</b> <glossary tag="command">command</glossary> to increase the efficiency of multiple FTP transfers.</p><p/><p><b>Parameters:</b></p><p>The <i>timeoutInSeconds</i> is a <href tag="../glossary/nondashnegative.xml">non-negative</href> <keyword tag="integer">integer</keyword>, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <href tag="../glossary/nondashnegative.xml">non-negative</href> <keyword tag="integer">integer</keyword>.</p><p/><p><b>Comments:</b></p><p>When LiveCode opens a socket to a host in order to upload or download a file via <b>ftp</b>, or to delete a file, it leaves the connection open for a time after the transaction completes. If another <keyword tag="file">file</keyword> is requested from the same FTP <glossary tag="server">server</glossary> during that time, LiveCode uses the same <glossary tag="socket">socket</glossary> instead of opening another one. This saves time if you are transferring multiple files with the same <glossary tag="server">server</glossary>, since the <glossary tag="socket">socket</glossary> does not need to be set up again for each file.</p><p/><p>By default, the timeout value is 15 seconds.</p><p/><p><code/><b>Note:</b><code/> If the <glossary tag="server">server</glossary> closes the connection, LiveCode does not attempt to keep it open. The <glossary tag="timeout">timeout</glossary> set by <b>libURLSetFTPStopTime</b> controls when LiveCode closes the connection from its end, but if the <glossary tag="server">server</glossary> closes the connection, a longer <glossary tag="timeout">timeout</glossary> has no effect.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> The <b>libURLSetFTPStopTime</b> <glossary tag="command">command</glossary> is part of the <glossary tag="Internet library">Internet library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "Internet Library" is selected in the list of script libraries.</p><p/><p><code/><b>Note:</b><code/> When included in a <glossary tag="standalone application">standalone application</glossary>, the <glossary tag="Internet library">Internet library</glossary> is implemented as a hidden <command tag="group">group</command> and made available when the <command tag="group">group</command> receives its first <message tag="openBackground">openBackground</message> message. During the first part of the <glossary tag="application">application's</glossary> startup process, before this <keyword tag="message box">message</keyword> is sent, the <b>libURLSetFTPStopTime</b> <glossary tag="command">command</glossary> is not yet available. This may affect attempts to use this <glossary tag="command">command</glossary> in <message tag="startup">startup</message>, <message tag="preOpenStack">preOpenStack</message>, <message tag="openStack">openStack</message>, or <message tag="preOpenCard">preOpenCard</message> <glossary tag="handler">handlers</glossary> in the <glossary tag="main stack">main stack</glossary>. Once the <glossary tag="application">application</glossary> has finished starting up, the <command tag="start using">library</command> is available and the <b>libURLSetFTPStopTime</b> <glossary tag="command">command</glossary> can be used in any <glossary tag="handler">handler</glossary>.</p>
  </description>
</doc>