unit mbknet_client;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
StdCtrls, ExtCtrls, IdTCPServer;
type
TForm1 =
class(TForm)
IdTCPClient1: TIdTCPClient;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Button2: TButton;
Timer1: TTimer;
IdTCPServer1: TIdTCPServer;
IdTCPClient2: TIdTCPClient;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
IDTCPClient1.Host := Edit1.Text;
with IDTCPClient1
do begin
Connect;
Caption := ReadLn;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IDTCPClient1.WriteLn('
HALLO SERVER');
// kläglicher versuch an den Server eine Nachricht zu senden
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if IDTCPClient1.Connected
then
Form1.Caption := IDTCPClient1.ReadLn()
// kläglicher Versuch Nachrichten vom Server zu empfangen
end;
end.