unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ScktComp, StdCtrls;
type
TForm1 =
class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
SocketServer: TServerSocket;
procedure ClientRead(Sender: Tobject; Socket: TCustomWinSocket);
procedure GetSocket(Sender: TObject; Socket: Integer;
var ClientSocket: TServerClientWinSocket);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ClientRead(Sender: Tobject; Socket: TCustomWinSocket);
begin
Socket.SendText('
Hallo')
end;
procedure TForm1.GetSocket(Sender: TObject; Socket: Integer;
var ClientSocket: TServerClientWinSocket);
begin
ClientSocket.SendText('
Hallo')
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
SocketServer := TServerSocket.Create(Application);
SocketServer.Port := 80;
SocketServer.Active := True;
SocketServer.OnClientRead := ClientRead;
SocketServer.OnGetSocket := GetSocket;
end;
end.