When using fiddlercore as web proxy in a WPF application and accessing web pages through a web browser control, there are multiple socket exceptions thrown. When fiddler is turned off, we do not see these exceptions.
Fiddler start code snippet:
const FiddlerCoreStartupFlags Flags = FiddlerCoreStartupFlags.Default;
if (!FiddlerApplication.IsStarted())
{
FiddlerApplication.Startup(PortNumber, Flags);
}
Fiddler shutdown snippet:
if (!FiddlerApplication.IsStarted())
{
return;
}
FiddlerApplication.BeforeRequest -= this.OnBeforeRequest;
FiddlerApplication.ResponseHeadersAvailable -= this.OnResponseHeadersAvailable;
FiddlerApplication.Shutdown();
Thread.Sleep(TimeoutMilliseconds);
Below was the exception analysis using Windbg on a dump created:
Exception object: 0388db20
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
125EEA10 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
125EEA30 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
125EEA50 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 038ba308
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0A7FF090 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0A7FF0B0 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0A7FF0D0 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0390bf54
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0674F2E4 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
StackTraceString: <none>
HResult: 80004005
*************
0:008>
Exception object: 03876124
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0660F350 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0660F370 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0660F390 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0388db20
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
125EEA10 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
125EEA30 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
125EEA50 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 038ba308
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0A7FF090 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0A7FF0B0 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0A7FF0D0 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0390bf54
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0674F2E4 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
StackTraceString: <none>
HResult: 80004005
Fiddler start code snippet:
const FiddlerCoreStartupFlags Flags = FiddlerCoreStartupFlags.Default;
if (!FiddlerApplication.IsStarted())
{
FiddlerApplication.Startup(PortNumber, Flags);
}
Fiddler shutdown snippet:
if (!FiddlerApplication.IsStarted())
{
return;
}
FiddlerApplication.BeforeRequest -= this.OnBeforeRequest;
FiddlerApplication.ResponseHeadersAvailable -= this.OnResponseHeadersAvailable;
FiddlerApplication.Shutdown();
Thread.Sleep(TimeoutMilliseconds);
Below was the exception analysis using Windbg on a dump created:
Exception object: 0388db20
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
125EEA10 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
125EEA30 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
125EEA50 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 038ba308
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0A7FF090 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0A7FF0B0 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0A7FF0D0 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0390bf54
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0674F2E4 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
StackTraceString: <none>
HResult: 80004005
*************
0:008>
Exception object: 03876124
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0660F350 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0660F370 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0660F390 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0388db20
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
125EEA10 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
125EEA30 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
125EEA50 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 038ba308
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0A7FF090 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
0A7FF0B0 0CEB335D UNKNOWN!Fiddler.BasePipe.Send(Byte[], Int32, Int32)+0x85
0A7FF0D0 0CEB51EA UNKNOWN!Fiddler.ServerChatter.LeakResponseBytes()+0xfa
StackTraceString: <none>
HResult: 80004005
*************
Exception object: 0390bf54
Exception type: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
InnerException: <none>
StackTrace (generated):
SP IP Function
0674F2E4 72C5D2F8 System_ni!System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)+0x6375e8
StackTraceString: <none>
HResult: 80004005