![]() Accessed 19082 times. |
KeepRAS v1.0 for Win32
Copyright © 2003 Ladislav Sedivy
Last updated Tuesday, November 21, 2006 |
KeepRAS is a program that will attempt to keep your Dial up connection (modem or DSL) active. There are many situations when you need your computer to stay connected at all times. For example when you run a web, ftp or telnet service. Unfortunately the modem or DSL connection often stop responding or just disconnect. An easy remedy is to reconnect the connection manually. Obviously this doesn't help when you are 100 miles away and you absolutely need a file from your machine. The usual "keep alive" utilities don't help in this case. Also, most of them are either too bulky or comercialware/shareware.
KeepRAS is a small (~60k) Win32 multithreaded application that doesn't require any special files or libraries. Just put it in its own directory, modify the supplied KeepRAS.ini file and that's it! The program will work on Win95/98 and WinNT/2000/XP. The only requirement is a functional dial up connection. Prior to use KeepRAS you must first modify KeepRAS.ini file. Here are the possible settings:
[Hosts] host0=www.server0.com host1=www.server1.com host2=www.server2.net ...
This section contains a list of hosts that will be pinged. The format is hostX=<server> where <server> is a server name or an IP number. The name is preferred since this way you will also test the DNS server. The list must start with host0 and it must contain at least one (host0) entry.
[Program]
| Interval= | Interval in minutes in which the hosts are pinged. Minimum value is 1; default (if not present) is 10 minutes. |
| WriteToFile= | This setting determines whether the log should be written into a file (KeepRAS.log in the current directory.) Default (if not present) is 0 (write all messages to screen.) Possible values are 0 or 1 |
| AutoScroll= | If 1, the window will always show the most current entry at the bottom of the window. Default (if not present) is 1. Possible values are 0 or 1. |
| AutoStart= | If 1, the KeepRAS starts pinging upon start up. If 0, you have to start it from the menu (Ping->Start) Default (if not present) is 1. Possible values are 0 or 1. |
| ScreenHistory= | This setting limits the history log. Default (if not present) is 0 (no limit.) Possible values are 0 and up (~30,000.) There is no limit on file log |
| RunBatch= | This setting contains the full path name of a program (.exe, .com, .bat, .cmd) that will be executed when the RAS successfully reconnects. If you need to run multiple programs, create a batch (or a .cmd) file. The program(s) will be executed asynchronously (KeepRAS will not wait for them to finish) If a single program is specified it will be executed minimized. Also the command prompt (when running a batch file) will be executed minimized. By default (if the setting is not present) the program will look for the KeepRAS.bat file in the current directory. |
| SoundAlert= | If 1, an alert is sound on a failed connection. Default (if not present) is 0. Possible values are 0 or 1. |
| SoundAlertFileName= | Full path name of a WAV file that will sound on a failed connection. If SoundAlert is set and SoundAlertFileName is empty or not present a system 'asterisk' sound will be used. |
| DisplayTrayIcon= | Default is 1. If 0, KeepRAS will not put its icon into the System Tray (To exit the program, you will have to kill it from the task manager) |
| TryReconnect= | Default is 1. If 0, KeepRAS will hang up unresponsive connection but it will not try to reconnect. It will; however, try to ping. This is to allow other programs to establish the connection. |
| PingTimeout= | This is the timeout for individual pings. The value is assumed to be in milliseconds. Default (if not set) is 1000ms. |
| AutoStart= | If set, KeepRAS will ping the first host immediately upon start up. Default is 1. |
[Connection0]
| PhoneNumber= | This is the phone number for your dial up connection. For DSL it should be empty unless your DSL provider tells you otherwise. (Applicable more for a modem connection.) |
| CallbackNumber= | Same as above. Leave it empty unless your ISP supports it. (Applicable more for a modem connection.) |
| Domain= | Fill in your domain. For DSL it should be empty unless your DSL provider tells you otherwise. (Applicable more for a modem connection.) |
| EntryName= | This is the only setting that must be set. Dial up networking entry name. Cannot be empty for DSL |
| UserName= | Fill in to override the phone book user name entry. Leave blank otherwise. |
| Password= | Fill in to override the phone book password entry. Leave blank otherwise. |
To test it, hang up your connection and start KeepRAS. Depending on the Interval
setting it may take a couple of minutes until the first ping. As soon as it
detects that the connection is down, KeepRAS will connect. By default, all
activity is displayed in its window.
The KeepRAS.ini file contains a list of (reliable) hosts that are pinged in a customizable interval. For example if you have list of following hosts and an interval=10 (minutes)
host0=www.server0.com host1=www.server1.com host2=www.server2.net ...
First, the host0 is pinged and if we get a valid reply, in 10 minutes host1 is pinged.
If host1 doesn't respond or times out KeepRAS will immediately ping next host until
it gets a valid reply. If no valid reply is received from all hosts, it is
safe to assume that either the DNS server is down or there is something else wrong.
At this point KeepRAS will attempt to disconnect the active connection (if there
is one) and reconnect it. The whole algorithm then starts over until the connection
is successful. After a successful connect an optional program(s) is executed.
You can have as many hosts as you wish. In fact the more the better.
With more hosts you will eliminate load on each host. For example if your
connection is up, the interval is 10 minutes and you have 12 hosts every host will
be pinged every 2 hours. This should be ok even for the most paranoid system
administrators.
Any comments, suggestions are welcome. Send an email to lac@sedivy.com. Source code is also available - email for details. Source (C++) code demonstrates following functions:
This software is provided "as is", without any guarantee made as to its suitability or fitness for any particular use. It may contain bugs, so use of this tool is at your own risk. I take no responsibility for any damage that may unintentionally be caused through its use.
You may distribute this tool freely as long as all files in the original distribution are included.
1/12/2003 1.0.0.9
- Fixed the ini file location problem (when run as a service on WinXP)
12/15/2002 1.0.0.8
- Host names can now be up to 255 chars each (Previously max 30 chars)
11/10/2000 1.0.0.7
- Tray tooltip shows the last logged message
- Minor formatting change for the time stamp
9/07/2000 1.0.0.6
- Added the PingTimeout setting
- Added immediate ping at startup (AutoStart setting)
- Removed tray icon flashing
8/10/2000 1.0.0.5
- Added the DisplayTrayIcon and TryReconnect settings. See description
and usage above.
8/02/2000 1.0.0.4
- Added the File->Save option to save the contents of the screen to a file.
- Added Ping->Ping Now option
- Changed the link options to delay load of rasapi32.dll, winmm.dll, comdlg32.dll
- Fixed a small memory leak caused by localtime(...) function. See MS KB article
Q104641
7/23/2000 1.0.0.3
- Fixed a weird problem in Win9x (no pings.)
7/11/2000 1.0.0.2
- SoundAlert and SoundAlertFileName settings added. See description
and usage above.
6/20/2000 1.0.0.1
- First release
|
Last modified Tuesday, November 21, 2006 lac@sedivy.com |
|
|