Previous Next

Thread: Keep web Application active

Last post 09-12-2008 6:29 AM by bapo_10@hotmail.com. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 09-11-2008, 4:24 PM

    Keep web Application active

    I have a web application that uses the COM model to connect to a remote server. It is currently running on my Local machine.

    I wish to push it out to a remote web server. I further wish to log on and config the application from time to time. Locally, I can disconnect the browser and the application still receives updates that I have subscribed to from the third party server.

    My problem seems to be that occasionaly the IIS Local server disconnects from the third party server. The connection is genuinely lost for some time. I can reconnect whilst connected to IIS with a browser (through code timers running on page).

    What page is IIS actually running when I disconnect the browser ?

    Can I run a Timer on such a page (perhaps a Master page), when the browser is disconnected?

    How do I get a process to run as a metronome or otherwise in a web application under IIS with the above circumstances I describe?

     I,m real stuck on this and new to IIS.

     Any help would be appreciated

     

    Robert

     

  • 09-11-2008, 5:01 PM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Lawrenceville, NJ
    • Posts 4,070
    • IIS MVPs

    Re: Keep web Application active

    You can schedule tinyget from the IIS Resource kit to periodically hit your web page.

  • 09-12-2008, 1:05 AM In reply to

    Re: Keep web Application active

    Tom

    Thanks for the response I dont know if I have explained this problem but here goes in a nutshell:

    I think my problem is a way to make my reconnect code run in my app when no browser is connected to my application - my application is located on a remote web server and - further connected to the price feed server. When a browser is connected I can get my reconnect code to run through a page timer.

    Do I have to write a script containing call to tinyget? If I have to write a script where do I put it to ensure the script is run on a schedule.

    Do I create a page with the script on it and call my reconnect routine somehow from there?

    Info: I cannot access web pages on the third party server it is a price feed for Forex that I subscribe to. 

    I could write a web service for my application and try to get a timer to stay alive in that. Do you know if this seem like a reasonable way to go?

    If i've missed your point on tinyget appologies and I got the following output: 

    C:\Program Files\IIS Resources\TinyGet>tinyget -srv:BOB-UXXXXXJ6DN -uri:http//l
    ocalhost/fxpiprunner/default.aspx -t
    bLoadSecurity
    WWWConnect::Connect("BOB-UXXXXJ6DN","80") //Altered
    IP = "XX.XX.XX.XX:80" //Altered
    source port: 1169

    REQUEST: **************
    GET http//localhost/fxpiprunner/default.aspx HTTP/1.1
    Host: BOB-US5UHB8J6DN
    Accept: */*


    RESPONSE: **************
    HTTP/1.1 400 Bad Request
    Server: Microsoft-IIS/5.1
    Date: Fri, 12 Sep 2008 04:41:14 GMT
    Connection: close
    Content-Type: text/html
    Content-Length: 87

    <html><head><title>Error</title></head><body>The parameter is incorrect. </body>
    </html>WWWConnect::Close("BOB-US5UHB8J6DN","80")
    closed source port: 1169

     

     

  • 09-12-2008, 5:05 AM In reply to

    • mukhtard
    • Top 25 Contributor
    • Joined on 07-07-2008, 9:13 PM
    • Redmond, WA
    • Posts 165

    Re: Keep web Application active

    I'm not sure why your URI for tinyget returns a bad request, the syntax looks good. Does the same exact URI work in a browser?

    Since tinyget is a console application you can create a batch file(.cmd/.bat)) and call tinyget in there. You can either use windows scheduler or have your batch file running all the time. If you decide on using the batch file the script would look some thing like:

    :LOOP
    timeout -t 600
    tinyget -srv:localhost -uri:http//localhost/fxpiprunner/default.aspx
    goto LOOP

    As you can see the above script runs tinyget every 10 minutes.

    Thanks,
    Mukhtar Desai
    IIS Performance Team

  • 09-12-2008, 6:14 AM In reply to

    Re: Keep web Application active

    Where do I locate/situate/put the batch file so that it runs periodically (task manager config is no good to me). Ideally I need to run it on a paid (not me administering) remote web server.

    The URI is good in the browser running on my local machine. The URI does not work if I tag HTTP1.1 on the end of the http request - should it?

    Thanks

    Robert

  • 09-12-2008, 6:29 AM In reply to

    Re: Keep web Application active

    This is how Im trying to get around the issue. There must be a simpler way someone please:

    namespace myWebService

    {

    using System;

    using System.Web;

    using System.Web.Services;

    using System.Collections.Generic;

    using System.Collections;

    using System.Threading;

    using System.Runtime.InteropServices;

    using System.Web.Services.Protocols;

    using realTimeTrade;

    using errorRecovery;

    using myFunctions;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using myDatesCollection;

    using System.Globalization;

    using TradesLogic;

    using loginRoutines;

    [WebService(Namespace = "http://tempuri.org/")]

    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.

    [System.Web.Script.Services.ScriptService]

    public class WService : System.Web.Services.WebService

    {

    [
    WebMethod]public string HelloWorld()

    {

    bool isInEvents =false;

    runTimeObj topTree = (runTimeObj)Application.Contents["topTree"];while (1 != 0)

    {

    if (DateTime.Now >= topTree.CheckLoginTime)

    {

    topTree.CheckLoginTime = DateTime.Now + new TimeSpan(0, 2, 0);

    bool isDisconnected = topTree.PriceAction.checkLoggedOut(topTree);if (isDisconnected)

    {

    isInEvents = (bool)topTree.PriceAction.ChangeEvents.ContainsKey("login");

    if (!isInEvents)

    {

    topTree.PriceAction.ChangeEvents.AddEvent(
    "login", topTree);

    }

    funcs.writeLogins("Connection Considered Lost" + DateTime.Now, topTree);

    }

    }

    isInEvents = (
    bool)topTree.PriceAction.ChangeEvents.ContainsKey("login");if (isInEvents)

    {

    int keyPosition = topTree.PriceAction.ChangeEvents.IndexOfKey("login");

    thisQElement qe = (thisQElement)topTree.PriceAction.ChangeEvents.GetByIndex(keyPosition);if (qe.State == true)

    {

    qe.State = false;

    topTree.CheckLoginTime = DateTime.Now + new TimeSpan(0, 3, 0);//Wont be checking login for 2 monutes

    System.Threading.Thread t = new System.Threading.Thread (topTree.PriceAction.Login.login);

    t.Start();

    funcs.writeLogin("Establish Connection " + DateTime.Now.ToString());

    }

    }

    }

    }

    }

    }

Page 1 of 1 (6 items)
Page view counter