On Sat, 12 Jun 2021 14:01:51 -0400, Selva Nair <selva.n...@gmail.com> wrote:

>> I wonder if there is some way (on Windows) to start the tunnel connection
>> from
>> the special comm program and then close it down when the comm session is
>> over
>> and the program closes.
>> I have written the comm program and I could add such a feature if it is
>> possible
>> to accoplish.
>>
>> OpenVPN-GUI is sort of a GUI program so I suspect it does not have any
>> useful
>> hooks...
>>
>
>We have some support for sending commands to the GUI to
>connect, disconnect etc.. See
>
>https://github.com/OpenVPN/openvpn-gui#send-commands-to-a-running-instance-of-openvpn-gui
>
>Selva

I have now tested the individual commands to connect and disconnect using a 
small program 
just for testing this interaction. It seems to work very well.

But when I integrated it into the main client application I found that what 
happens on the connect call

openvpn-gui.exe --command connect serverconfig

is that the connection dialog pops up showing all of the progress messages 
while connecting, 
but at this time the call to openvpn-client returns *before* the connection is 
established so my 
following actions are errored out because there is not yet a connection.
When I traced this in the debugger with a breakpoint directly following the 
call it reaches the breakpoint 
before the dialog has finished...

So now I am wondering if the connect call just *triggers* openvpn-gui to start 
the connect process 
but it does so in its main thread so it exits the user call?

Or maybe it stays on until it is either connected or fails (which I assumed), 
in which case I have to 
investigate how the call is actually handled from my application.
I *have* set the call flag to wait for the called program to finish, and I am 
logging this.
Turns out that the time is just about 600 ms  but the connect dialog stays up 
much longer...

I use a standard command to run an application with a set of arguments...
Developing using FreePascal.

-- 
Bo Berglund
Developer in Sweden



_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to