Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi all,

I have setup a VPN server for a client of mine, there are three incoming connections to the server. I am using RAS dial and every once in a while one of these connections drop. Normally there is no one near these computers and they are supposed to stream some data once in a while to the main server.

I would like to create an application which will dial these connections on boot and that will once in a while send a packet through the connection to make sure it is still active and if not, redial the connection.

I would also like to have a basic "ping" feature so if someone wants to make sure the connection is working, they can click on a button and see replies or if possible a little "OK" status.

I did a course on C# many years ago, have not touched it since and just would like to be pointed in the right direction. I would prefer to write the application myself rather than use other software.
Posted
Updated 17-May-11 2:58am
v2

Please refer to the following link: -

http://www.asterworld.com/en/soft/009.html[^]

Let me know if the link was helpful

--
AJ
 
Share this answer
 
not sure if wininet.dll would be of assistance in this case but you could check
to see if the connection is alive by using

C#
[DllImport("wininet.dll", SetLastError = true)]
        private static extern bool InternetCheckConnection(string lpszUrl, int dwFlags, int dwReserved);
private bool Connected;
if (InternetCheckConnection("http://www.google.com",1,0))
            {
                Connected = true;
            }
if (!Connected)
{
  // try reconnection here

}
 
Share this answer
 
v2
Thank you for the ideas, neither of them really do what I want, I will continue to do research and post the solution here once I find it for anyone else who requires it...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900