TFTP Class
Properties Methods Events Configuration Settings Errors
The TFTPClient class is used to exchange files with TFTP servers via the TFTP protocol defined in RFC 783.
Class Name
IPWorks_TFTP
Procedural Interface
ipworks_tftp_open(); ipworks_tftp_close($res); ipworks_tftp_register_callback($res, $id, $function); ipworks_tftp_get_last_error($res); ipworks_tftp_get_last_error_code($res); ipworks_tftp_set($res, $id, $index, $value); ipworks_tftp_get($res, $id, $index); ipworks_tftp_do_config($res, $configurationstring); ipworks_tftp_do_doevents($res); ipworks_tftp_do_getfile($res); ipworks_tftp_do_interrupt($res); ipworks_tftp_do_putfile($res); ipworks_tftp_do_reset($res);
Remarks
To use the class, first specify the TFTPServer, then a LocalFile and a RemoteFile, and then call GetFile or PutFile. The Transfer event shows the progress of the transfer.
Potential transmission errors and packet loss are managed by the Timeout property which controls the maximum time to wait for a response from the server, and the MaxRetransmits property which specifies how many times to resend a failed packet before giving up.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
Idle | The current status of the class. |
LocalFile | The file on the local host to transfer the data to/from. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
MaxRetransmits | The number of times to retry sending a failed packet before disconnecting. |
RemoteFile | The file on the remote host. |
RetransmitTimeout | Maximum time in seconds to wait for a reply packet from the server before retransmitting the last packet. |
TFTPPort | The UDP port where the remote TFTP server is listening. |
TFTPServer | The address of the TFTP server to exchange files with. |
Timeout | A timeout for the class. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
DoEvents | Processes events from the internal message queue. |
GetFile | Download a RemoteFile from the TFTP server. |
Interrupt | Interrupt the current method. |
PutFile | Upload a file specified by LocalFile to the TFTP server. |
Reset | Reset the class. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
EndTransfer | Fired when a file completes downloading/uploading. |
Error | Information about errors during data delivery. |
StartTransfer | Fired when a file starts downloading/uploading. |
Transfer | Fired during file download/upload. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
BlockSize | Determines the block size that will be used when transferring a file. |
TransferMode | Determines the transfer mode that will be used when transferring a file. |
CaptureIPPacketInfo | Used to capture the packet information. |
DestinationAddress | Used to get the destination address from the packet information. |
DontFragment | Used to set the Don't Fragment flag of outgoing packets. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the class binds. |
MaxPacketSize | The maximum length of the packets that can be received. |
QOSDSCPValue | Used to specify an arbitrary QOS/DSCP setting (optional). |
QOSTrafficType | Used to specify QOS/DSCP settings (optional). |
ShareLocalPort | If set to True, allows more than one instance of the class to be active on the same local port. |
SourceIPAddress | Used to set the source IP address used when sending a packet. |
SourceMacAddress | Used to set the source MAC address used when sending a packet. |
UseConnection | Determines whether to use a connected socket. |
UseIPv6 | Whether or not to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |