ICMPPort Class
Properties Methods Events Configuration Settings Errors
The ICMPPort class is used to facilitate ICMP communications. It can act both as a client and a server and communicate with any number of hosts simultaneously, as well as generate and receive broadcast packets.
Syntax
IPWorksICMPPort
IPWorksICMPPortSwift
Remarks
The interface of the class is similar to the interface of IPPort, only much simpler. The class is activated/deactivated by using the Active property. This property enables or disables sends or receives. Data can be sent in the same way as IPPort, using the Send method and Text parameter or the DataToSend property. The destination is specified using the RemoteHost property. The class automatically creates an ICMP header containing MessageType, MessageSubType, and a checksum for the message.
If the UseConnection config setting is set to True, then a local association is created with the remote host. Otherwise, the class can receive datagrams (packets) from any host, and send datagrams to any host. Packets can be broadcast on the local net by setting the destination to 255.255.255.255.
Inbound data is received through the DataIn event.
The operation of the class is almost completely asynchronous. All the calls, except the ones that deal with domain name resolution, operate through Windows messages (no blocking calls). The gain in performance is considerable when compared to using blocking calls.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
- acceptData | Enables or disables data reception (the DataIn event). |
- active | Enables or disables sending and receiving of data. |
- dataToSend | A string of data to be sent to the remote host. Write-only property. |
- dontRoute | If set to True, it forces the socket to send data directly to interface (no routing). |
- localHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
- messageSubType | The subtype of the ICMP message (part of the ICMP header). |
- messageType | The type of the ICMP message (part of the ICMP header). |
- remoteHost | The address of the RemoteHost. Domain names are resolved to IP addresses. |
- timeout | A timeout for the class. |
- timeToLive | The time to live (TTL) value for the ICMP packets sent by the class. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
- config | Sets or retrieves a configuration setting. |
- doEvents | Processes events from the internal message queue. |
- reset | Reset the class. |
- send | Sends data to the remote host. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
- onDataIn | Fired when new ICMP messages come in. |
- onError | Information about errors during data delivery. |
- onReadyToSend | Fired when the class is ready to send data. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
DontFragment | Whether the DontFragment control flag is set. |
IcmpDllTimeout | The timeout for the class when using the icmp.dll. |
MaxMessageSize | The maximum length of the messages that can be received. |
MulticastTTL | The time to live (TTL) value for multicast ICMP packets sent by the class. |
ReceiveAllMode | Enables a socket to receive all IPv4 or IPv6 packets on the network. |
TimeoutInMilliseconds | The timeout is treated as milliseconds. |
UseConnection | Determines whether to use a connected socket. |
UseICMPDLL | Use the icmp.dll included on Windows Systems. |
UseIPHLPDLL | Use the iphlpapi.dll included on Windows Systems. |
UseIPv6 | Whether to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |