Re: [fpc-pascal] How to check if a network is available?

2021-07-02 Thread Marc Weustink via fpc-pascal
On 18-6-2021 13:49, Bo Berglund via fpc-pascal wrote: I would like to know how I can check if a remote network is available, i.e. if the VPN system has succeeded to connect the remote network. I need this in a class that connects an OpenVPN tunnel on demand and takes it down after use.

Re: [fpc-pascal] How to check if a network is available?

2021-06-21 Thread Luca Olivetti via fpc-pascal
El 20/6/21 a les 19:38, Jean SUZINEAU via fpc-pascal ha escrit: Ping uses ICMP protocol. I don't have currently Indy installed on my machines, but I think you can find pascal components for ICMP client and even ICMP server. I think that this way you can do a single "ping", a single ICMP

Re: [fpc-pascal] How to check if a network is available?

2021-06-20 Thread Jean SUZINEAU via fpc-pascal
Ping uses ICMP protocol. I don't have currently Indy installed on my machines, but I think you can find pascal components for ICMP client and even ICMP server. I think that this way you can do a single "ping", a single ICMP request. It seems that Synapse has ping  support too:

Re: [fpc-pascal] How to check if a network is available?

2021-06-20 Thread Bo Berglund via fpc-pascal
On Fri, 18 Jun 2021 08:34:43 -0400, James Richters via fpc-pascal wrote: >Do a Ping to an address on the network to see if it's connected? > I would need a ping with only one execution so I can put it into a loop and break after a successful ping or break after some timeout value. Seems like

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Jean SUZINEAU via fpc-pascal
Le 18/06/2021 à 17:07, Bo Berglund via fpc-pascal a écrit : I will need to check this in my connector class, the address to look for has to be a config item in my application so it can be modified if need be without rebuilding the app. Have to figure out how to: - Retrieve the output of the

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Bo Berglund via fpc-pascal
On Fri, 18 Jun 2021 16:39:52 +0200, Jean SUZINEAU via fpc-pascal wrote: >I've never used open vpn, may be the 10.117 is defined in your >configuration file ? > >For the vpns I've used, the ip adressed were fixed. The tunnel IP address is defined server side and the route is pushed to the

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Jean SUZINEAU via fpc-pascal
I've never used open vpn, may be the 10.117 is defined in your configuration file ? For the vpns I've used, the ip adressed were fixed. ( for route, you can type too something like "route print 10.117.*" ) ___ fpc-pascal maillist -

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Bo Berglund via fpc-pascal
On Fri, 18 Jun 2021 15:00:18 +0200, Jean SUZINEAU via fpc-pascal wrote: >May be you can get some information with the "route" command . > >If you run "route print" in cmd command prompt, you can get information >on the different networks available. >

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Tony Whyman via fpc-pascal
Yep, that's the golden rule in networking. The only way that you know that a bi-directional path is open is an end-to-end ping. Even then, you only know that it's open at the time the ping completed. If you are using TCP then you can always enable keepalive packets that effectively do the

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread Jean SUZINEAU via fpc-pascal
May be you can get some information with the "route" command . If you run "route print" in cmd command prompt, you can get information on the different networks available. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/route_ws2008 (I couldn't find the doc

Re: [fpc-pascal] How to check if a network is available?

2021-06-18 Thread James Richters via fpc-pascal
Do a Ping to an address on the network to see if it's connected? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] How to check if a network is available?

2021-06-18 Thread Bo Berglund via fpc-pascal
I would like to know how I can check if a remote network is available, i.e. if the VPN system has succeeded to connect the remote network. I need this in a class that connects an OpenVPN tunnel on demand and takes it down after use. Unfortunately openvpn-gui does not have an API call to do