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
this...
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
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 for
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 same
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.
>
>https://docs.microsoft.com/en-us/windows-ser
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 - fpc-pascal@list
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
client
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 TProc
Ooops... little overflow bug
My computer has reached 33 days of uptime today and with
var
t, d, h, m, s: Integer;
you switch to the negative side ...
I got a display like : -8:-4:-52
Replacing with QWord solved the problem (I imagine DWord would just
allow for something like 66 days)
var
I'm using GetSaveFileNameA() in a windows console program to obtain a
save-as directory and file name, I am passing sending it a default file
name with:
TFileName.lpstrFile:=Pchar(DefaultFileName);
DefaultFileName is an AnsiString that contains a full path and filename.
This all works fine a
The Windows API doesn't understand what an 'AnsiString' is and cannot resize it
dynamically like FreePascal would do as it is used.
You need to use something like
buf: array[0..512] of char;
TFileName.nMaxFile := sizeof(buf);
But then you should also handle the possibility that the dir is grea
I'm converting my AnsiString to a Pchar with
TFileName.lpstrFile:=Pchar(DefaultFileName);
But I didn't understand the meaning of
TFileName.nMaxFile:=100; I thought it was the maximum number of files to
display or something.. not the maximum number of characters in the file
name. which it appea
I'm not familiar with GetSaveFileNameA, but usually for the size of a
FileName buffer I use the constant MAX_PATH which is defined in unit
SysUtils.
MAX_PATH itself seems to be an alias from system unit where it is
defined accordingly to the operating system (260 on windows, 4096 on
Linux, 1
I haven't seen your reply.
Le 18/06/2021 à 23:50, James Richters via fpc-pascal a écrit :
So now I have:
TFileName.nMaxFile:= Length(DefaultFileName)+1;
TFileName.lpstrFile:=Pchar(DefaultFileName);
I need the +1 for the #0 at the end of the Pchar, and now it works
fine, and I can have strings
>MAX_PATH itself seems to be an alias from system unit where it is defined
accordingly to the operating system (260 on windows, 4096 on Linux, 1024 on
BSD, Solaris and Darwin).
>It's unlikely, but this way you can end up with the corruption of the byte
right after the memory block DefaultFileName
15 matches
Mail list logo