unit modul;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
StdCtrls, ExtCtrls, Mask, ComCtrls, IdTCPServer,threadtest;
// <- threadunit
type
TForm1 =
class(TForm)
Label1: TLabel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Memo1: TMemo;
connect: TButton;
Button2: TButton;
Edit1: TEdit;
ip: TEdit;
Port: TEdit;
Edit2: TEdit;
Button1: TButton;
client: TIdTCPClient;
Timer1: TTimer;
server: TIdTCPServer;
TabSheet2: TTabSheet;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Memo2: TMemo;
serverport: TEdit;
servername: TEdit;
Button4: TButton;
Button5: TButton;
Memo3: TMemo;
Button3: TButton;
procedure connectClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure serverConnect(AThread: TIdPeerThread);
procedure serverExecute(AThread: TIdPeerThread);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private-Deklarationen }
public
fthread: tmythread;
//hier soll ein neuer thread erstelt werden, aber
end; mythread ist unbekannt!
var
Form1: TForm1;
implementation
uses thread;
{$R *.dfm}
procedure TForm1.connectClick(Sender: TObject);
begin
client.Port := strtoint(port.Text);
client.Host :=
ip.Text;
client.Connect;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
client.Writeln(edit2.Text + '
: ' + edit1.text);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.Lines[0] := '
Chatprotokoll';
memo2.lines[0] := '
Chatprotokoll';
memo3.Lines[0] := '
Angemeldete Chatter';
end;