unit u_TestServer;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPServer;
type
TfMainForm =
class(TForm)
TCP_Connection: TIdTCPServer;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TCP_ConnectionConnect(AContext: TIdContext);
procedure TCP_ConnectionExecute(AContext: TIdContext);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
fMainForm: TfMainForm;
implementation
USES Client_Communication;
{$R *.dfm}
procedure TfMainForm.FormShow(Sender: TObject);
begin
TCP_Connection.Active:=true;
end;
procedure TfMainForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
TCP_Connection.Active:=false;
end;
procedure TfMainForm.TCP_ConnectionConnect(AContext: TIdContext);
begin
AContext.Data:=TClientComm.Create;
end;
procedure TfMainForm.TCP_ConnectionExecute(AContext: TIdContext);
begin
Handle_IncomingData(AContext);
end;
end.