Servidor:
Cuando se Conecta;
Código:
AThread.Connection.WriteLn(timetostr(now));
listbox2.Items.Insert(0,Athread.Connection.ReadLn);
Cuando se ejecuta:
Código:
procedure TForm1.ServidorExecute(AThread: TIdPeerThread);
var
Command : String;
begin
listbox1.Items.Insert(0,Athread.Connection.ReadLn+'- Hora de Ejecucion: '+FormatDateTime('hh:nn:ss',now));
Command := AThread.Connection.ReadLn;
if command='0' then
AThread.Connection.WriteLn(FormatDateTime('hh:nn:ss',now))
else if command='1' then
AThread.Connection.WriteLn(FormatDateTime('dd/mm/yyyy',date))
else if command='2' then
AThread.Connection.WriteLn('HOLA cliente como estas');
end;
Lo del cliente ya puse como me conecto y como hago la petición al servidor, espero que me pueda ayudar...