unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdCustomTCPServer,
IdTCPServer, idContext;
type
TForm1 =
class(TForm)
TCPServer: TIdTCPServer;
Memo1: TMemo;
procedure TCPServerExecute(AContext: TIdContext);
procedure TCPServerConnect(AContext: TIdContext);
procedure TCPServerDisconnect(AContext: TIdContext);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.TCPServerConnect(AContext: TIdContext);
begin
Memo1.Lines.Add('
Verbindung: ' + AContext.Binding.PeerIP);
end;
procedure TForm1.TCPServerDisconnect(AContext: TIdContext);
begin
Memo1.Lines.Add('
Verbindungsabbruch: ' + AContext.Binding.PeerIP);
end;
procedure TForm1.TCPServerExecute(AContext: TIdContext);
var str :
string;
begin
str := AContext.Connection.IOHandler.ReadLn;
Memo1.Lines.Add('
Nachricht: ' + str);
end;
end.