How to detect / set VPN connection?

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
hstijnen
Junior Boarder
Junior Boarder
Posts: 32
Joined: 11.04.2012, 08:49

How to detect / set VPN connection?

Post by hstijnen »

Hi,

I've a database on an external server. Before connecting to the database I have to setup a VPN connection to the server.

Is it possible with ZEOS to detect if the VPN connection exists or to make the connection?

Thanks for help
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello hstijnen,

I think this is not the scope of database connection components. As far as I know there is no common mechanism to know if a VPN connection has been made because there are a lot of different kinds of VPNs.
In Windows most VPN Connections install their own virtual network card. Maybe you can check if these cards signal they have a connection. Or your VPN solution has some kind of an API where you can check this.
You also could decide to skip the VPN solution and use some solution like stunnel. stunnel will create the connection automatically when your application connects to it.
Best regards,

Jan
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

hstijnen,

Simplest solution would be to try opening the connection and intercept the error message. Probably it will say something like 'host not found' when the VPN connection is not available. At least I would think so, as otherwise it would not be very usefull to require a VPN when the server is publicly visible.

Mark
Image
Locked