Force client reconnect

5 posts, 2 answers
  1. Christopher
    Christopher avatar
    3 posts
    Member since:
    Jan 2015

    Posted 16 Jan 2015 Link to this post

    I'm wondering if there's a way to force a client reconnect in an extension? I looked through the network flags and didn't see anything but I did find the fiddler.network.timeouts.clientpipe.resuse setting. The extension I'm working on spins up background threads to make it's own webrequests against an F5 however I'm getting locked to a specific machine due to using the same client connection. I'd rather not muck with the preferences and instead force a reset before each new web requests. Is there a way to do this?

    Thanks in advance!
    -C
  2. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 19 Jan 2015 Link to this post

    Hey, Chris!

    There are a few ways to do this.

    One way would be to, inside your PeekAtResponseHeaders event handler, do something like:

       ServerChatter serverPipe = oSession.oResponse.pipeServer;
       if (null != serverPipe) serverPipe.ReusePolicy = PipeReusePolicy.NoReuse;

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Christopher
    Christopher avatar
    3 posts
    Member since:
    Jan 2015

    Posted 20 Jan 2015 in reply to Eric Lawrence Link to this post

    Howdy E! :)

    That's brilliant! Though... it's not quite working for me. I would have expected to see in the statistics the "ClientConnected" time to change for each request and yet its staying the same. I verified I'm indeed setting the policy.

    Though perhaps I'm misunderstanding what is actually happening. I had expected with the example you gave that after a response comes back, I would have basically told the server pipe i'm using to re-establish a connection the next time a request came through the pipe.

    Given that the "ClientConnected" time stamp doesn't change however it makes me feel like the policy is being ignored. Am I forgetting something?
  4. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 20 Jan 2015 Link to this post

    Howdy, Chris--

    The important factor to remember is that for every request/response, there are two connections-- 

       1. from the client to Fiddler and 
       2. from Fiddler to the server.

    The code snippet I provided below prevents reuse of the server connection while allowing the client connection to be reused.

    If you also wish to prevent the client connection from being reused, you can either add a Connection: close header to the response, or you can call oSession.PoisonClientPipe().

    All the best,

    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Christopher
    Christopher avatar
    3 posts
    Member since:
    Jan 2015

    Posted 20 Jan 2015 in reply to Eric Lawrence Link to this post

    Ah! That makes great sense. Your first response then achieves my original task. Thank you very much!
Back to Top