unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, IdTCPServer, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient;
type
TMainform_Form =
class(TForm)
TCPClient: TIdTCPClient;
TCPServer: TIdTCPServer;
Chatfield_REdit: TRichEdit;
Button1: TButton;
Eingabe_Edit: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TCPServerExecute(AThread: TIdPeerThread);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Mainform_Form: TMainform_Form;
implementation
{$R *.dfm}
procedure TMainform_Form.Button1Click(Sender: TObject);
begin
TCPClient.Connect;
{ TCPClient.WriteLn(Eingabe_Edit.Text);
Eingabe_Edit.Text := '';
TCPClient.Disconnect;
TCPServer.Active := False; }
end;
procedure TMainform_Form.FormCreate(Sender: TObject);
begin
TCPServer.Active := True;
end;
procedure TMainform_Form.TCPServerExecute(AThread: TIdPeerThread);
begin
AThread.Connection.WriteLn('
Connected...');
end;
procedure TMainform_Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
TCPClient.Disconnect;
TCPServer.Active := False;
end;
end.