This is a migrated thread and some comments may be shown as answers.

Force client reconnect

4 Answers 184 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 16 Jan 2015, 07:17 AM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Eric Lawrence
Telerik team
answered on 19 Jan 2015, 07:13 PM
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.

 
0
Christopher
Top achievements
Rank 1
answered on 20 Jan 2015, 06:10 AM
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?
0
Accepted
Eric Lawrence
Telerik team
answered on 20 Jan 2015, 04:27 PM

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.

 
0
Christopher
Top achievements
Rank 1
answered on 21 Jan 2015, 03:15 AM
Ah! That makes great sense. Your first response then achieves my original task. Thank you very much!
Tags
Fiddler Classic
Asked by
Christopher
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Christopher
Top achievements
Rank 1
Share this question
or