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
[Expand]
TPingClient = class(TWinsock2RAWClient)
Function declarations
[Expand]
procedure TPingClient.SetSize(ASize:LongWord);
Description: Set the size in bytes of the data for the ping request
[Expand]
procedure TPingClient.SetCount(ACount:LongWord);
Description: Set the number of ping requests to perform
[Expand]
procedure TPingClient.SetTimeout(ATimeout:LongWord);
Description: Set the time to wait for a reply to each request (Milliseconds)
[Expand]
procedure TPingClient.SetTimeToLive(ATimeToLive:Byte);
Description: Set the time to live in hops for each request
[Expand]
procedure TPingClient.SetNoFragment(ANoFragment:Boolean);
Description: Set the don't fragment bit in the header of each request
[Expand]
function TPingClient.GetLastCount:LongWord;
Description: Get the current count after the latest request
[Expand]
function TPingClient.GetErrorCode:LongInt;
Description: Get the error code from the latest request
[Expand]
function TPingClient.GetErrorText:String;
Description: Get the error message from the latest request
[Expand]
procedure TPingClient.ResetPing;
Description: Reset the state and clear the current ping request
[Expand]
function TPingClient.FirstPing(const AHost:String):Boolean;
Description: Start a new ping sequence to the specified host or address
[Expand]
function TPingClient.NextPing:Boolean;
Description: Continue pinging the current address with the current parameters
Return to Unit Reference