Difference between revisions of "TPingClient"

From Ultibo.org
Jump to: navigation, search
(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%;"|&nbsp;
 
|-
 
|-
 
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FSize:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FTimeout:LongWord;</code>
 +
| &nbsp;
 
|-
 
|-
 
|colspan="2"|&nbsp;  
 
|colspan="2"|&nbsp;  
 +
|-
 +
| <code>FTimeToLive:Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FNoFragment:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FLastHost:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLastAddress:String;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FLastTime:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FReplyAddress:String;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FLastSequence:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLastIdentifier:Word;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FSendCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FReceiveCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLostCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetSize(ASize:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetCount(ACount:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetTimeout(ATimeout:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetTimeToLive(ATimeToLive:Byte);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetNoFragment(ANoFragment:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetLastCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetErrorCode:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetErrorText:String;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>procedure ResetPing; virtual;</code>
 +
| &nbsp;
 
|-
 
|-
 
|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>
 +
| &nbsp;
 +
|-
 +
| <code>property Count:LongWord read FCount write SetCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Timeout:LongWord read FTimeout write SetTimeout;</code>
 +
| &nbsp;
 
|-
 
|-
 
|colspan="2"|&nbsp;  
 
|colspan="2"|&nbsp;  
 +
|-
 +
| <code>property TimeToLive:Byte read FTimeToLive write SetTimeToLive;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property NoFragment:Boolean read FNoFragment write SetNoFragment;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property LastHost:String read FLastHost;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property LastAddress:String read FLastAddress;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property LastTime:LongWord read FLastTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property LastCount:LongWord read GetLastCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ReplyAddress:String read FReplyAddress;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property LastSequence:Word read FLastSequence;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property LastIdentifier:Word read FLastIdentifier;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property SendCount:LongWord read FSendCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ReceiveCount:LongWord read FReceiveCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property LostCount:LongWord read FLostCount;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property ErrorCode:LongInt read GetErrorCode;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ErrorText:String read GetErrorText;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FirstPing(const AHost:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function NextPing:Boolean;</code>
 +
| &nbsp;
 
|-
 
|-
 
|}
 
|}
Line 34: Line 195:
 
----
 
----
  
''None defined''
 
  
 +
<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]
constructor TPingClient.Create;
Description: Constructor for TPingClient class


[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