unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, ExtCtrls,
StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Timer1: TTimer;
client: TIdTCPClient;
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Listbox1.items.add(client.Socket.ReadLn);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
client.Connect;
sleep(1500);
application.ProcessMessages;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
client.Socket.WriteLn('
s');
application.ProcessMessages;
timer1.Enabled:=true;
application.ProcessMessages;
end;
end.