Das müsste ca. So aussehen:
Delphi-Quellcode:
//Server:
Procedure TForm1.Timer1Timer(Sender: TObject);
var i:Integer;
begin
with ServerSocket1 Do
begin
for i:=0 to Socket.ActiveConnections Do
begin
Socket.SendText('PING');
end;
end;
end;
//Client:
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
with ClientSocket1 do
begin
if Socket.Receivetext = 'PING' then
begin
Socket.SendText('PONG');
end else
begin
Jobliste.Lines.Add(Socket.ReceiveText);
end;
end;
end;
Der Rest dürfte nicht mehr schwer sein