Thema
:
Delphi
Routerproblem
Einzelnen Beitrag anzeigen
Rastaman
Registriert seit: 6. Jan 2005
Ort: Lübbecke
575 Beiträge
Turbo C++
#
11
Re: Routerproblem
24. Jan 2005, 16:53
Server:
markieren
Code:
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Server.Port := 4662;
Server.Active := True;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Server.Active := False;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Server.Socket.SendText(Edit1.Text);
end;
procedure TForm1.ServerClientRead(Sender: TObject; Socket: TCustomWinSocket);
begin
Memo1.Lines.Add(Socket.ReceiveText)
end;
end.
Client
markieren
Code:
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Client.Host := '254.254.254.254';
Client.Port := 4662;
Client.Active := True;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Client.Active := False;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Client.Socket.SendText(Edit1.Text)
end;
procedure TForm1.ClientRead(Sender: TObject; Socket: TCustomWinSocket);
begin
Memo1.Lines.Add(Socket.ReceiveText)
end;
end.
Zitat
Rastaman
Öffentliches Profil ansehen
Mehr Beiträge von Rastaman finden