Community discussion forum

high rate http requests

  • 3 months ago

    Dears, I hope you are all well

    I have a problem and I hope you can help me to solve it,

    First let me describe my system,

    My system consists of two applications The first one is asp.ne 2 web site and the other is an application called kannel it is desktop Linux application

    The interaction between the two applications is done via http request So asp.net web site generates httprequest and then sends it to kannel (the other application) - Everything is working well with low rate of generation Http request (say 8 request per second) but with high rate of generating http requests (say 85 request per second) my web application can start sending http requests until the generated requests reach for example 3000 request (this count depending on the generation rate, for example if the generation rate is 50/second the count will be about 3800)and then it cannot send any request to kannel and throw exception “the connection was closed unexpected” ,not that only but also I cannot open any website such as Google using my internet explorer - Note : during this problem happened the kannel application is continue running (I test it) and also my application still running - Note also this problem is happened during three or four seconds and then the sending rasume again until it reaches the prvious count and then stop again …..and so on

    The method which is used for sending

    private bool SendMessage(MessageEntity message)
    {
        bool flag = false;
        System.Net.WebRequest request = null;
        System.Net.WebResponse reponse = null;
        System.IO.StreamReader stream = null;
        try
        {
            request = System.Net.WebRequest.Create(url);
            reponse = request.GetResponse();
            flag = reponse != null;
        }
        catch (Exception exc)
        {
            new ErrorHandler.ErrorHandler().Add(exc.Message + "   " + message.MessageText, exc.StackTrace, exc.TargetSite.ToString());
            flag = false;
        }
        finally
        {
            stream.Dispose();
            reponse.Close();
            request.Abort();
        }
        return flag;
    }
    
    Post was edited on 21/10/2008 18:44:48 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).