Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Running into timing issues with HTTPGet HTTPPost

Running into timing issues with HTTPGet HTTPPost

Scheduled Pinned Locked Moved Web Development
csharpvisual-studiosysadminwindows-adminxml
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LongRange Shooter
    wrote on last edited by
    #1

    We have a web application that is required to use HTTP post and get to pass data back and forth. Under IIS 6 everything works fine. The client receives the response (usually two packets) and everything runs as expected. We moved the application to Visual Studio 2008, IIS 7, and converted our handlers to be properly recognized (not compatibility mode). We still have all of our longer running transactions function normally. However our logoff transaction failed. I ran netstat and saw that with the login transaction that there was a port opened in a CLOSE_WAIT state. The GetResponse method works as expected. The logoff however shows no such port state and when the client goes to read the response it crashes because there is a stream object that goes nowhere. (no port in CLOSE_WAIT state or any other state) I then went to the server side and stepped through our logic to issue the response to the client. In each case I get the status after the respond and it shows 200 OK as the response. Meaning the the transaction was a success and the response was a success. The last thing I do is flush the buffer. The only difference with the logout is that it is probably only 1 packet while even login is at least 2. If I pause the server right after the flush, the client takes off and successfully get the response object. If I do not pause it, the client crashes and no port is sitting in the CLOSE_WAIT state. We really need to get this fixed ASAP. Do I put a thread wait after the flush???? Will that stop the entire web server???? What do I do to get this working? Thanks -- code for the WriteResponse is listed below. Visual Studio 2008 -- IIS 7.0 -- Vista Ultimate with all updates applied

    private void WriteResponse(HttpContext context, string response, ReplyCodeEnum reply, string replyText)

    {

     StringTemplate template = GetResponseTemplate(context, reply);//see who's calling this
    
     template.SetAttribute("code", ReplyCodes.GetCode(reply));
    
     template.SetAttribute("text", replyText);
    
     template.SetAttribute("response", response);
    
     response = template.ToString();
    
     // Finish specifying response headers
    
     context.Response.ContentType = "text/xml";
    
     // Write response
    
     context.Response.Write(response);
    
     // Store content for Http Log
    
     context.Items.Add("Content", response);
    
     //TODO out
    
     string s = context.Response.Status;
    
     context.Response.Buffer = true;
    
     context.R
    
    L 1 Reply Last reply
    0
    • L LongRange Shooter

      We have a web application that is required to use HTTP post and get to pass data back and forth. Under IIS 6 everything works fine. The client receives the response (usually two packets) and everything runs as expected. We moved the application to Visual Studio 2008, IIS 7, and converted our handlers to be properly recognized (not compatibility mode). We still have all of our longer running transactions function normally. However our logoff transaction failed. I ran netstat and saw that with the login transaction that there was a port opened in a CLOSE_WAIT state. The GetResponse method works as expected. The logoff however shows no such port state and when the client goes to read the response it crashes because there is a stream object that goes nowhere. (no port in CLOSE_WAIT state or any other state) I then went to the server side and stepped through our logic to issue the response to the client. In each case I get the status after the respond and it shows 200 OK as the response. Meaning the the transaction was a success and the response was a success. The last thing I do is flush the buffer. The only difference with the logout is that it is probably only 1 packet while even login is at least 2. If I pause the server right after the flush, the client takes off and successfully get the response object. If I do not pause it, the client crashes and no port is sitting in the CLOSE_WAIT state. We really need to get this fixed ASAP. Do I put a thread wait after the flush???? Will that stop the entire web server???? What do I do to get this working? Thanks -- code for the WriteResponse is listed below. Visual Studio 2008 -- IIS 7.0 -- Vista Ultimate with all updates applied

      private void WriteResponse(HttpContext context, string response, ReplyCodeEnum reply, string replyText)

      {

       StringTemplate template = GetResponseTemplate(context, reply);//see who's calling this
      
       template.SetAttribute("code", ReplyCodes.GetCode(reply));
      
       template.SetAttribute("text", replyText);
      
       template.SetAttribute("response", response);
      
       response = template.ToString();
      
       // Finish specifying response headers
      
       context.Response.ContentType = "text/xml";
      
       // Write response
      
       context.Response.Write(response);
      
       // Store content for Http Log
      
       context.Items.Add("Content", response);
      
       //TODO out
      
       string s = context.Response.Status;
      
       context.Response.Buffer = true;
      
       context.R
      
      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I have no idea if this will help but I would try it[^]

      led mike

      L 1 Reply Last reply
      0
      • L led mike

        I have no idea if this will help but I would try it[^]

        led mike

        L Offline
        L Offline
        LongRange Shooter
        wrote on last edited by
        #3

        Thanks Mike. Microsoft suggested first that we try context.Response.Close(); and see if that works. I think it does the same thing but derived from the context object. Michael

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups