Files
cefsharp/patch.diff
T

51 lines
1.9 KiB
Diff

From fbc5bf970a720677f8bb5cceb08eeee4d9e5b488 Mon Sep 17 00:00:00 2001
From: Bodekaer <michael@bodekaer.dk>
Date: Wed, 17 Sep 2014 14:56:59 +0200
Subject: [PATCH] Fixed #482 WCF timeout issue
---
CefSharp/Internals/BrowserProcessServiceHost.cs | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/CefSharp/Internals/BrowserProcessServiceHost.cs b/CefSharp/Internals/BrowserProcessServiceHost.cs
index 3a97971..efbd413 100644
--- a/CefSharp/Internals/BrowserProcessServiceHost.cs
+++ b/CefSharp/Internals/BrowserProcessServiceHost.cs
@@ -5,6 +5,7 @@
using System;
using System.Net.Security;
using System.ServiceModel;
+using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Threading.Tasks;
@@ -66,11 +67,22 @@ namespace CefSharp.Internals
operationContextTaskCompletionSource = null;
}
- public static NetNamedPipeBinding CreateBinding()
+ public static CustomBinding CreateBinding()
{
var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
binding.MaxReceivedMessageSize = SixteenMegaBytesInBytes;
- return binding;
+ binding.ReceiveTimeout = TimeSpan.MaxValue;
+ binding.SendTimeout = TimeSpan.MaxValue;
+ binding.OpenTimeout = TimeSpan.MaxValue;
+ binding.CloseTimeout = TimeSpan.MaxValue;
+
+ // Ensure binding connection stays open indefinitely until closed
+ var customBinding = new CustomBinding(binding);
+ var connectionSettings = customBinding.Elements.Find<NamedPipeTransportBindingElement>().ConnectionPoolSettings;
+ connectionSettings.IdleTimeout = TimeSpan.MaxValue;
+ connectionSettings.MaxOutboundConnectionsPerEndpoint = 0;
+
+ return customBinding;
}
}
}
\ No newline at end of file
--
1.8.3.msysgit.0