FtpOptions.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <html>
  3. <head>
  4. <title>FtpOptions</title>
  5. <link rel="stylesheet" type="text/css" href="doc.css">
  6. </head>
  7. <body>
  8. <h1>FtpOptions</h1>
  9. <p>Set connection options.</p>
  10. <h2>SYNOPSIS</h2>
  11. <pre>
  12. #include &lt;ftplib.h&gt;
  13. int FtpOptions(int opt, long val, netbuf *nControl);
  14. </pre>
  15. <h2>PARAMETERS</h2>
  16. <dl>
  17. <dt><b>opt</b></dt>
  18. <dd>Specifies the option to change. Valid options are
  19. FTPLIB_CONNMODE, FTPLIB_CALLBACK, FTPLIB_IDLETIME,
  20. FTPLIB_CALLBACKARG, and FTPLIB_CALLBACKBYTES.</dd>
  21. <dt><b>val</b></dt>
  22. <dd>Specifies the new value for the option. The value may need to
  23. by cast to a long.</dd>
  24. <dt><b>nControl</b></dt>
  25. <dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>
  26. or <a href="FtpAccess.html">FtpAccess()</a>.</dd>
  27. </dl>
  28. <h2>DESCRIPTION</h2>
  29. <p>FtpOptions() changes the options for a connection handle. A data
  30. connection inherits the options assigned to the control connection
  31. it is created from. Callbacks are only called on file data
  32. connections.</p>
  33. <p>New programs should
  34. call <a href="FtpSetCallback.html">FtpSetCallback()</a>
  35. and <a href="FtpClearCallback.html">FtpClearCallback()</a> to change
  36. callback options.</p>
  37. <p>The following options and values are recognized.</p>
  38. <dl>
  39. <dt>FTPLIB_CONNMODE</dt>
  40. <dd>Specifies the connection mode. Either FTPLIB_PASSIVE or
  41. FTPLIB_PORT.</dd>
  42. <dt>FTPLIB_CALLBACK (deprecated)</dt>
  43. <dd>Specifies the address of a user callback routine.</dd>
  44. <dt>FTPLIB_IDLETIME (deprecated)</dt>
  45. <dd>Specifies the socket idle time in milliseconds that triggers
  46. calling the user's callback routine.</dd>
  47. <dt>FTPLIB_CALLBACKARG (deprecated)</dt>
  48. <dd>Specifies an argument to pass to the user's callback
  49. routine.</dd>
  50. <dt>FTPLIB_CALLBACKBYTES (deprecated)</dt>
  51. <dd>Specifies the number of bytes to transfer between calls to the
  52. user's callback routine.</dd>
  53. </dl>
  54. <p>The connection mode tells ftplib if it should use PASV or PORT
  55. to establish data connections. The default is specified as a build
  56. option.</p>
  57. <p>See <a href="FtpSetCallback.html">FtpSetCallback()</a> for a
  58. description of using callbacks.</p>
  59. <h2>RETURN VALUE</h2>
  60. <p>Returns 1 if a valid option was specified and the value is
  61. legal. Otherwise, returns 0.</p>
  62. </body>
  63. </html>