Ver Mensaje Individual
  #3  
Antiguo 12-12-2007
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.286
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Hay un poco de "morralla" porque lo estoy usando dentro de un programa, pero esto te debería servir:

Código Delphi [-]
procedure TPingThread.Execute;
var
  rp:TReplyStatus;
begin

  Self.IdIcmp := TIdIcmpClient.Create(nil);
  // proteccion
  try
    Self.IdIcmp.Host := Self.FIPServer;
    Self.IdIcmp.ReceiveTimeout := 2000;
    // Asignar Evento
    IdIcmp.OnReply := PingReply;

    ini := Now;

    try
      // Lanzar el PING
      IdIcmp.Ping;

    except
      on E:EIdSocketError do begin
        rp := TReplyStatus.Create;
        rp.FromIpAddress := '0.0.0.0';
        rp.ToIpAddress := '0.0.0.0';
        rp.ReplyStatusType := rsError;
        rp.Msg := E.Message;
        PingReply(IdIcmp, rp);
      end;
    end;

  finally
    FreeAndNil(Self.IdIcmp);
  end;
end;

En PingReply o en el evento OnReply tienes los datos de la respuesta, tal y como te han dicho.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita