Class TTFTPSend

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TTFTPSend = class(TSynaClient)

Description

Implementation of TFTP client and server

Note: Are you missing properties for specify server address and port? Look to parent TSynaClient too!

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public function SendFile(const Filename: string): Boolean;
Public function RecvFile(const Filename: string): Boolean;
Public function WaitForRequest(var Req: word; var filename: string): Boolean;
Public procedure ReplyError(Error: word; Description: string);
Public function ReplyRecv: Boolean;
Public function ReplySend: Boolean;

Properties

Published property ErrorCode: integer read FErrorCode;
Published property ErrorString: string read FErrorString;
Published property Data: TMemoryStream read FData;
Published property RequestIP: string read FRequestIP write FRequestIP;
Published property RequestPort: string read FRequestPort write FRequestPort;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public function SendFile(const Filename: string): Boolean;

Upload Data as file to TFTP server.

Public function RecvFile(const Filename: string): Boolean;

Download file from TFTP server to Data.

Public function WaitForRequest(var Req: word; var filename: string): Boolean;

Acts as TFTP server and wait for client request. When some request incoming within Timeout, result is True and parametres is filled with information from request. You must handle this request, validate it, and call ReplyError, ReplyRecv or ReplySend for send reply to TFTP Client.

Public procedure ReplyError(Error: word; Description: string);

send error to TFTP client, when you acts as TFTP server.

Public function ReplyRecv: Boolean;

Accept uploaded file from TFTP client to Data, when you acts as TFTP server.

Public function ReplySend: Boolean;

Accept download request file from TFTP client and send content of Data, when you acts as TFTP server.

Properties

Published property ErrorCode: integer read FErrorCode;

Code of TFTP error.

Published property ErrorString: string read FErrorString;

Human readable decription of TFTP error. (if is sended by remote side)

Published property Data: TMemoryStream read FData;

MemoryStream with datas for sending or receiving

Published property RequestIP: string read FRequestIP write FRequestIP;

Address of TFTP remote side.

Published property RequestPort: string read FRequestPort write FRequestPort;

Port of TFTP remote side.


Generated by PasDoc 0.9.0 on 2012-04-23 21:38:57