Solved

Keep alive connection

Posted on 2004-10-14
4
608 Views
Last Modified: 2008-02-26
I need to make a small program, that will send a ping to a server once every 5 minutes or so , so it will keep a connection alive.

We run a pronto SCO server and users on a remote connection are getting lockups if they leave the console inactive for more then 10 minutes.

I need the program to start when windows starts and issue two 32 byte pings once every 5 minutes.

I am presuming this will help with the lockups, unless anyone knows of a better way to achieve this.

Can this be done easily in javascript?

Regards

0
Comment
Question by:karl_Pacey
  • 2
4 Comments
 
LVL 15

Expert Comment

by:justinbillig
ID: 12315686
<body onload="HeartBeat( );">


then your heartbeat function would look something like this


function HeartBeat( )
{
           // I have no idea how to ping the server, so this may not help

           // Call this function again in 5 minutes
           setTimeout( "HeartBeat( )", 5000 )
}
0
 
LVL 25

Accepted Solution

by:
devic earned 125 total points
ID: 12315947
1. save as ping.vbs

=========  ping.vbs ==============
Dim strHostOrIP,strCmd
strHostOrIP = "www.sembel.net"

strCmd = "%SystemRoot%\system32\ping.exe -n 1 " & strHostOrIP
Set objSh  = CreateObject("WScript.Shell")
Set objCmd = objSh.Exec(strCmd)
==============================


2. Add it to Scheduled Tasks.
0
 

Author Comment

by:karl_Pacey
ID: 12318224
Runs like a charm, however is there anyway to surpress the command prompt opening on top of other applications each time the script runs.  ie: i can't see an option to hide the command prompt
0
 
LVL 25

Expert Comment

by:devic
ID: 12319252
hi karl_Pacey,

I don't know how, but I thought for another script, you don't need a ping, but "Keep alive connection"...

===========pong.vbs===============
theURL = "http://www.sembel.net"
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
      objHTTP.SetTimeouts 1000, 1000, 1000, 1000
    objHTTP.open "GET", theURL, false
    objHTTP.send
    'msgBox objHTTP.responseText
Set objHTTP = Nothing
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 42
Javascript_Set_dropdown_value 7 33
jQuery - following an example but can I save data server side? 20 50
Jquery keyup 4 19
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question