I have simple SignalR application with I hosted in IIS. When IIS is 8 from Win server 2012R2 IE11 was connected via WebSocket and everything work fine. But when I hosted on IIS 7.5 or IIsExpress 8 IE11 was connected vie forewerFrame and after 10 minutes memory consumed by IE was doubled.
Here Is my code SignalR config
public static void Configuration(IAppBuilder app)
{
app.MapSignalR(new HubConfiguration
{
EnableDetailedErrors = true,
EnableJavaScriptProxies = true
});
}
Hub
[HubName("testHub")]
public class TestHub : Hub
{
[HubMethodName("update")]
public void Update()
{
Clients.All.update(new TestData
{
Name = "Test1",
Date = DateTime.Now,
Value1 = 100,
Value2 = 200,
Value3 = 300,
Value4 = 400,
Value5 = 500,
Value6 = 600,
Value7 = 700,
Value8 = 800,
Value9 = 900,
});
}
}
public class TestData
{
public string Name { get; set; }
public DateTime Date { get; set; }
public int Value1 { get; set; }
public int Value2 { get; set; }
public int Value3 { get; set; }
public int Value4 { get; set; }
public int Value5 { get; set; }
public int Value6 { get; set; }
public int Value7 { get; set; }
public int Value8 { get; set; }
public int Value9 { get; set; }
}
View
<h3>Homepage</h3>
@section scripts
{
@Scripts.Render("~/bundles/signalR")
<script type="text/javascript" src="@Url.Content("~/signalr/hubs")"></script>
<script>
$(function () {
$.connection.testHub.on('update', function (item) { update(item); });
$.connection.hub.start().done(function() {
setInterval(function() { $.connection.testHub.server.update(); }, 100);
});
});
var count = 0;
function update(item) {
count++;
$('#count').val(count);
}
</script>
}
<span> count:<input type="text" id="count" value="0" /></span>
Does anybody knows what is wrong? I updated all nugets. jQuery 2.1.3, SignalR 2.2.0
Thanks
It's a known issue with Forever Frame in IE: https://github.com/SignalR/SignalR/issues/809
Try to force long polling.
Change your code accordingly:
$.connection.hub.start({ transport: 'longPolling' }).done(function() {
setInterval(function() { $.connection.testHub.server.update(); }, 100);
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments