Difference between revisions of "TPingClient"
From Ultibo.org
(Created page with "Return to Unit Services __TOC__ === Description === ---- ''To be documented'' === Class definitions === ---- <div class="toccolours mw-collapsible mw-...") |
|||
Line 18: | Line 18: | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>constructor Create;</code> | ||
+ | | style="width: 50%;"| | ||
|- | |- | ||
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | ||
+ | |- | ||
+ | | <code>FSize:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FTimeout:LongWord;</code> | ||
+ | | | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FTimeToLive:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FNoFragment:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FLastHost:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FLastAddress:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FLastTime:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FReplyAddress:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FLastSequence:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FLastIdentifier:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FSendCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FReceiveCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FLostCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetSize(ASize:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetCount(ACount:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetTimeout(ATimeout:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetTimeToLive(ATimeToLive:Byte);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetNoFragment(ANoFragment:Boolean);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetLastCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetErrorCode:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetErrorText:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div> | ||
+ | |- | ||
+ | | <code>procedure ResetPing; virtual;</code> | ||
+ | | | ||
|- | |- | ||
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property Size:LongWord read FSize write SetSize;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property Count:LongWord read FCount write SetCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property Timeout:LongWord read FTimeout write SetTimeout;</code> | ||
+ | | | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property TimeToLive:Byte read FTimeToLive write SetTimeToLive;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property NoFragment:Boolean read FNoFragment write SetNoFragment;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property LastHost:String read FLastHost;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property LastAddress:String read FLastAddress;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property LastTime:LongWord read FLastTime;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property LastCount:LongWord read GetLastCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property ReplyAddress:String read FReplyAddress;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property LastSequence:Word read FLastSequence;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property LastIdentifier:Word read FLastIdentifier;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property SendCount:LongWord read FSendCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property ReceiveCount:LongWord read FReceiveCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property LostCount:LongWord read FLostCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property ErrorCode:LongInt read GetErrorCode;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property ErrorText:String read GetErrorText;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function FirstPing(const AHost:String):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function NextPing:Boolean;</code> | ||
+ | | | ||
|- | |- | ||
|} | |} | ||
Line 34: | Line 195: | ||
---- | ---- | ||
− | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">constructor TPingClient.Create;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Constructor for TPingClient class</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.SetSize(ASize:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the size in bytes of the data for the ping request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.SetCount(ACount:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the number of ping requests to perform</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.SetTimeout(ATimeout:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the time to wait for a reply to each request (Milliseconds)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.SetTimeToLive(ATimeToLive:Byte);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the time to live in hops for each request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.SetNoFragment(ANoFragment:Boolean);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the don't fragment bit in the header of each request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TPingClient.GetLastCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current count after the latest request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TPingClient.GetErrorCode:LongInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the error code from the latest request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TPingClient.GetErrorText:String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the error message from the latest request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure TPingClient.ResetPing;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset the state and clear the current ping request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TPingClient.FirstPing(const AHost:String):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Start a new ping sequence to the specified host or address</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Host | ||
+ | | The host name or address to ping | ||
+ | |- | ||
+ | ! Note | ||
+ | | After the first ping, NextPing should be called repeatedly until completed. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TPingClient.NextPing:Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Continue pinging the current address with the current parameters</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Once LastCount equals Count the sequence is complete and this method will return False | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 04:45, 2 November 2022
Return to Unit Services
Description
To be documented
Class definitions
TPingClient = class(TWinsock2RAWClient)
public
| |
constructor Create;
|
|
private
| |
FSize:LongWord;
|
|
FCount:LongWord;
|
|
FTimeout:LongWord;
|
|
FTimeToLive:Byte;
|
|
FNoFragment:Boolean;
|
|
FLastHost:String;
|
|
FLastAddress:String;
|
|
FLastTime:LongWord;
|
|
FReplyAddress:String;
|
|
FLastSequence:Word;
|
|
FLastIdentifier:Word;
|
|
FSendCount:LongWord;
|
|
FReceiveCount:LongWord;
|
|
FLostCount:LongWord;
|
|
procedure SetSize(ASize:LongWord);
|
|
procedure SetCount(ACount:LongWord);
|
|
procedure SetTimeout(ATimeout:LongWord);
|
|
procedure SetTimeToLive(ATimeToLive:Byte);
|
|
procedure SetNoFragment(ANoFragment:Boolean);
|
|
function GetLastCount:LongWord;
|
|
function GetErrorCode:LongInt;
|
|
function GetErrorText:String;
|
|
protected
| |
procedure ResetPing; virtual;
|
|
public
| |
property Size:LongWord read FSize write SetSize;
|
|
property Count:LongWord read FCount write SetCount;
|
|
property Timeout:LongWord read FTimeout write SetTimeout;
|
|
property TimeToLive:Byte read FTimeToLive write SetTimeToLive;
|
|
property NoFragment:Boolean read FNoFragment write SetNoFragment;
|
|
property LastHost:String read FLastHost;
|
|
property LastAddress:String read FLastAddress;
|
|
property LastTime:LongWord read FLastTime;
|
|
property LastCount:LongWord read GetLastCount;
|
|
property ReplyAddress:String read FReplyAddress;
|
|
property LastSequence:Word read FLastSequence;
|
|
property LastIdentifier:Word read FLastIdentifier;
|
|
property SendCount:LongWord read FSendCount;
|
|
property ReceiveCount:LongWord read FReceiveCount;
|
|
property LostCount:LongWord read FLostCount;
|
|
property ErrorCode:LongInt read GetErrorCode;
|
|
property ErrorText:String read GetErrorText;
|
|
function FirstPing(const AHost:String):Boolean;
|
|
function NextPing:Boolean;
|
Function declarations
constructor TPingClient.Create;
Description: Constructor for TPingClient class
Note | None documented |
---|
procedure TPingClient.SetSize(ASize:LongWord);
Description: Set the size in bytes of the data for the ping request
Note | None documented |
---|
procedure TPingClient.SetCount(ACount:LongWord);
Description: Set the number of ping requests to perform
Note | None documented |
---|
procedure TPingClient.SetTimeout(ATimeout:LongWord);
Description: Set the time to wait for a reply to each request (Milliseconds)
Note | None documented |
---|
procedure TPingClient.SetTimeToLive(ATimeToLive:Byte);
Description: Set the time to live in hops for each request
Note | None documented |
---|
procedure TPingClient.SetNoFragment(ANoFragment:Boolean);
Description: Set the don't fragment bit in the header of each request
Note | None documented |
---|
function TPingClient.GetLastCount:LongWord;
Description: Get the current count after the latest request
Note | None documented |
---|
function TPingClient.GetErrorCode:LongInt;
Description: Get the error code from the latest request
Note | None documented |
---|
function TPingClient.GetErrorText:String;
Description: Get the error message from the latest request
Note | None documented |
---|
procedure TPingClient.ResetPing;
Description: Reset the state and clear the current ping request
Note | None documented |
---|
function TPingClient.FirstPing(const AHost:String):Boolean;
Description: Start a new ping sequence to the specified host or address
Host | The host name or address to ping |
---|---|
Note | After the first ping, NextPing should be called repeatedly until completed. |
function TPingClient.NextPing:Boolean;
Description: Continue pinging the current address with the current parameters
Note | Once LastCount equals Count the sequence is complete and this method will return False |
---|
Return to Unit Reference