Files Transfer Protocol
Binary WebSocket transport for transferring files between connected clients with configurable packet sizes, authorization controls, and QoS delivery guarantees.
Binary WebSocket transport for transferring files between connected clients with configurable packet sizes, authorization controls, and QoS delivery guarantees.
Send and receive files of any size through WebSocket connections with built-in chunking and progress tracking.
The Files protocol uses WebSocket binary frames to transfer files between clients and server. Files are split into configurable-size packets, transmitted sequentially, and reassembled on the receiving end. The protocol includes authorization controls to restrict who can send or receive files, QoS levels for delivery guarantees, and acknowledgment mechanisms to confirm successful receipt.
Send a file to a connected client through the WebSocket server.
uses
sgcWebSocket_Client, sgcWebSocket_Types,
sgcWebSocket_Protocol_Files_Client;
var
WSClient: TsgcWebSocketClient;
FilesProtocol: TsgcWSPClient_Files;
procedure TForm1.FormCreate(Sender: TObject);
begin
WSClient := TsgcWebSocketClient.Create(nil);
WSClient.Host := 'myserver.example.com';
WSClient.Port := 443;
FilesProtocol := TsgcWSPClient_Files.Create(nil);
FilesProtocol.Client := WSClient;
FilesProtocol.OnFileReceived := OnFileReceived;
WSClient.Active := True;
end;
procedure TForm1.ButtonSendFileClick(Sender: TObject);
begin
// Send a file to the server
FilesProtocol.SendFile('C:\Documents\report.pdf');
end;
procedure TForm1.OnFileReceived(Sender: TObject;
const aFileName: string);
begin
Memo1.Lines.Add('File received: ' + aFileName);
end;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.