Сетевое железо - статьи

       

Демонстрация пингов


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdRawBase, IdRawClient,
IdIcmpClient, StdCtrls, IdUDPBase, IdUDPClient, IdSNTP;

type
TForm1 = class (TForm)
Button1: TButton;
ListBox1: TListBox;
IdIcmpClient1: TIdIcmpClient;
IdSNTP1: TIdSNTP;
procedure Button1Click (Sender: TObject);

procedure IdIcmpClient1Reply (ASender: TComponent;
const AReplyStatus: TReplyStatus);

private
{Private declarations}
public
{Public declarations}
end;

var
Form1: TForm1;


implementation
uses pingModule,icmp;
{$R *.dfm}

procedure TForm1.Button1Click (Sender: TObject);

var Reply:TsmICMP_Echo_Reply;
begin
Self.IdIcmpClient1.Host:='localhost';
Self.IdIcmpClient1.TTL:=192;
Self.IdIcmpClient1.Ping;
Ping ('127.0.0.1',nil,Reply,5000);

ListBox1.Items.Add ('RawReply:'+IntToStr (Reply.RoundTripTime));

end;

procedure TForm1.IdIcmpClient1Reply (ASender: TComponent;
const AReplyStatus: TReplyStatus);

begin
ListBox1.Items.Add ('Reply:'+IntToStr (AReplyStatus.MsRoundTripTime));

end;

end.



Содержание раздела