TsgcWSPClient_Files

This is the Server Files Protocol Component, you need to drop this component in the form and select a TsgcWebSocketClient Component using Client Property.

 

Methods

   SendFile: sends a file to the server, you can set the following parameters

aSize: size of every packet in bytes.

aData: user custom data, here you can write any text you think is useful for the server.

aQoS: type of quality of service.

aFileId: if empty, will be set automatically.

 

Properties

   Files: files properties

 

    BufferSize: default size of every packet sent, in bytes.

 

    SaveDirectory: the directory where all files will be stored.

 

    QoS: quality of service

 

    Interval: interval to check if a qosLevel2 message has been sent.

 

    Level: level of quality of service.

 

qosLevel0: the message is sent.

 

qosLevel1: the message is sent and you get an acknowledgment if the message has been processed.

 

qosLevel2: the message is sent, you get an acknowledgment if the message has been processed and packets are requested by the receiver.

 

    Timeout: maximum wait time.

 

    ClearReceivedStreamsOnDisconnect: if disabled, when reconnects, try to resume file download for qosLevel2, by default is enabled.

 

    ClearSentStreamsOnDisconnect: tif disabled, when reconnects, try to resume file upload for qosLevel2, by default is enabled.

 

Events

   OnFileBeforeSent: fired before a file is sent. You can use this event to check file data before is sent.

 

   OnFileReceived: fired when a file is successfully received.

 

   OnFileReceivedAuthorization: fired to check if a file can be received.

 

   OnFileReceivedError: fired when an error occurs receiving a file.

 

   OnFileReceivedFragment: fired when a fragment file is received. Useful to show progress.

 

   OnFileSent: fired when a file is successfully sent.

 

   OnFileSentAcknowledgment: fired when a fragment is sent and the receiver has processed.

 

   OnFileSentError: fired when an error occurs sending a file.

 

   OnFileSentFragment: fired when a fragment file is sent. Useful to show progress.