[Gambas-user] ICMP

jose.rodriguez at cenpalab.cu jose.rodriguez at cenpalab.cu
Tue May 25 20:05:44 CEST 2021


May 25, 2021 1:10 PM, "John Dovey" <dovey.john at gmail.com> wrote:

> What i would like to do is iterate through the list checking reachability (ping is ok for that) but
> also the availability of the advertised services. Simply “are you responding on that port, and if
> so what is the response”. I hat I’m considering doing is just using a scripted telnet session
> (doable within Gambas I think) and capturing the output, then reading that to see what the status
> is.
> 


Checking availability of a TCP port service should be easily doable with TCP sockets, but you might have to actually send something after connection if you want to check the response (though some services, as you can check with telnet, will reply with just enough). Ping should also be doable, but you'd need to look up the ICMP echo protocol RFCs, or related documentation (there is some example code around, mainly in C, which might also help).

For example:
https://www.geeksforgeeks.org/ping-in-c/

Regards,

Joe1962



More information about the User mailing list