Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Delete DOM nodes in forever frame in JS client after every 50th recei…

…ved message.

Fixes #458
  • Loading branch information...
commit 301d6037c4bb24ab2fb154416fb693c0dc7bc794 1 parent dcabd78
@DamianEdwards DamianEdwards authored
View
229 SignalR.sln
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2010
+# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR", "SignalR\SignalR.csproj", "{1B9A82C4-BCA1-4834-A33E-226F17BE070B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR.Client", "SignalR.Client\SignalR.Client.csproj", "{EB46B9C6-EE37-48F9-835E-E49580E40E0A}"
@@ -16,6 +16,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR.Stress", "SignalR.Stress\SignalR.Stress.csproj", "{758D93C8-7985-4F55-82DA-8BA5198CF4EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR.Hosting.AspNet", "SignalR.Hosting.AspNet\SignalR.Hosting.AspNet.csproj", "{0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7} = {12609D9C-B4C9-4553-B364-D2C297F85CE7}
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR.Hosting.Owin", "SignalR.Hosting.Owin\SignalR.Hosting.Owin.csproj", "{A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}"
EndProject
@@ -62,76 +65,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Any CPU.Build.0 = Release|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|x86.ActiveCfg = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Any CPU.Build.0 = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|x86.ActiveCfg = Release|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|x86.ActiveCfg = Debug|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Any CPU.Build.0 = Release|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|x86.ActiveCfg = Release|Any CPU
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Any CPU.ActiveCfg = Debug|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|x86.ActiveCfg = Debug|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|x86.Build.0 = Debug|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Any CPU.ActiveCfg = Release|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Mixed Platforms.Build.0 = Release|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|x86.ActiveCfg = Release|x86
- {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|x86.Build.0 = Release|x86
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Any CPU.Build.0 = Release|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|x86.ActiveCfg = Release|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Any CPU.Build.0 = Release|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|x86.ActiveCfg = Release|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Any CPU.Build.0 = Release|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|x86.ActiveCfg = Release|Any CPU
{055F2118-FE29-4219-A28A-3D6F0889652E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{055F2118-FE29-4219-A28A-3D6F0889652E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{055F2118-FE29-4219-A28A-3D6F0889652E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -142,16 +75,36 @@ Global
{055F2118-FE29-4219-A28A-3D6F0889652E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{055F2118-FE29-4219-A28A-3D6F0889652E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{055F2118-FE29-4219-A28A-3D6F0889652E}.Release|x86.ActiveCfg = Release|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|x86.ActiveCfg = Debug|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Any CPU.Build.0 = Release|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|x86.ActiveCfg = Release|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}.Release|x86.ActiveCfg = Release|Any CPU
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|x86.ActiveCfg = Debug|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|x86.Build.0 = Debug|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Any CPU.ActiveCfg = Release|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Mixed Platforms.Build.0 = Release|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|x86.ActiveCfg = Release|x86
+ {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|x86.Build.0 = Release|x86
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|x86.ActiveCfg = Release|Any CPU
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -162,6 +115,36 @@ Global
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82}.Release|x86.ActiveCfg = Release|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {3B71F0AE-D4B6-4F47-BF62-333D45615673}.Release|x86.ActiveCfg = Release|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|x86.ActiveCfg = Release|Any CPU
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|x86.ActiveCfg = Debug|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Debug|x86.Build.0 = Debug|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Any CPU.ActiveCfg = Release|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|Mixed Platforms.Build.0 = Release|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|x86.ActiveCfg = Release|x86
+ {758D93C8-7985-4F55-82DA-8BA5198CF4EF}.Release|x86.Build.0 = Release|x86
{8BF43A5B-4C96-4490-A9AF-5A057AC37C24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BF43A5B-4C96-4490-A9AF-5A057AC37C24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BF43A5B-4C96-4490-A9AF-5A057AC37C24}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
@@ -184,36 +167,6 @@ Global
{8FD9E25A-2268-4F6E-85F3-B83DC018ECE9}.Release|Mixed Platforms.Build.0 = Release|x86
{8FD9E25A-2268-4F6E-85F3-B83DC018ECE9}.Release|x86.ActiveCfg = Release|x86
{8FD9E25A-2268-4F6E-85F3-B83DC018ECE9}.Release|x86.Build.0 = Release|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Any CPU.ActiveCfg = Debug|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|x86.ActiveCfg = Debug|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|x86.Build.0 = Debug|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Any CPU.ActiveCfg = Release|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Mixed Platforms.Build.0 = Release|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|x86.ActiveCfg = Release|x86
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|x86.Build.0 = Release|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Any CPU.ActiveCfg = Debug|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|x86.ActiveCfg = Debug|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Debug|x86.Build.0 = Debug|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Any CPU.ActiveCfg = Release|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|Mixed Platforms.Build.0 = Release|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|x86.ActiveCfg = Release|x86
- {12609D9C-B4C9-4553-B364-D2C297F85CE7}.Release|x86.Build.0 = Release|x86
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Debug|x86.ActiveCfg = Debug|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Any CPU.Build.0 = Release|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {42DE29B3-67CA-4003-A4F6-CA4F21C8991C}.Release|x86.ActiveCfg = Release|Any CPU
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Debug|Any CPU.ActiveCfg = Debug|x86
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Debug|Mixed Platforms.Build.0 = Debug|x86
@@ -224,16 +177,66 @@ Global
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Release|Mixed Platforms.Build.0 = Release|x86
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Release|x86.ActiveCfg = Release|x86
{9A64F050-8F95-46B2-906C-0BFCA7A27E94}.Release|x86.Build.0 = Release|x86
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A2BD866D-906A-4742-AB3B-DB8740830400}.Release|x86.ActiveCfg = Release|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A5726CD0-DE18-40A9-A2EF-C2765EEDBA30}.Release|x86.ActiveCfg = Release|Any CPU
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|x86.ActiveCfg = Debug|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Debug|x86.Build.0 = Debug|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Any CPU.ActiveCfg = Release|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|Mixed Platforms.Build.0 = Release|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|x86.ActiveCfg = Release|x86
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5}.Release|x86.Build.0 = Release|x86
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|x86.ActiveCfg = Release|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {FBA09237-84CC-4383-BD12-CDF58E4020E8} = {505538C3-B34D-4B43-BDE6-C6E974AB03A6}
{1EA34A62-E03E-45CF-A9C9-82D2DA0FCD82} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
{8BF43A5B-4C96-4490-A9AF-5A057AC37C24} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
{8FD9E25A-2268-4F6E-85F3-B83DC018ECE9} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
- {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
{9A64F050-8F95-46B2-906C-0BFCA7A27E94} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
+ {E0223FDC-0982-4D80-B6C2-BFAA6C6748C5} = {7E3D992A-8F37-4C5D-AD42-E052522816C5}
+ {FBA09237-84CC-4383-BD12-CDF58E4020E8} = {505538C3-B34D-4B43-BDE6-C6E974AB03A6}
EndGlobalSection
EndGlobal
View
14 SignalR/Scripts/jquery.signalR.js
@@ -933,7 +933,19 @@
transportLogic.ajaxSend(connection, data);
},
- receive: transportLogic.processMessages,
+ receive: function (connection, data) {
+ var cw;
+ transportLogic.processMessages(connection, data);
+ // Delete the script & div elements
+ connection.frameMessageCount = (connection.frameMessageCount || 0) + 1;
+ if (connection.frameMessageCount > 50) {
+ connection.frameMessageCount = 0;
+ cw = connection.frame.contentWindow || connection.frame.contentDocument;
+ if (cw && cw.document) {
+ $("body", cw.document).empty();
+ }
+ }
+ },
stop: function (connection) {
var cw = null;
View
2  SignalR/Scripts/jquery.signalR.min.js
@@ -6,4 +6,4 @@
* Licensed under the MIT.
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md
*/
-(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:u.processMessages,stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
+(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:function(t,i){var r;u.processMessages(t,i),t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>50&&(t.frameMessageCount=0,r=t.frame.contentWindow||t.frame.contentDocument,r&&r.document&&n("body",r.document).empty())},stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
View
10 SignalR/Transports/ForeverFrameTransport.cs
@@ -6,9 +6,10 @@ namespace SignalR.Transports
{
public class ForeverFrameTransport : ForeverTransport
{
- private const string _initPrefix = "<!DOCTYPE html><html><head>" +
- "<title>SignalR Forever Frame Transport Stream</title></head>\r\n" +
- "<body>\r\n" +
+ private const string _initPrefix = "<!DOCTYPE html>" +
+ "<html>" +
+ "<head>" +
+ "<title>SignalR Forever Frame Transport Stream</title>\r\n" +
"<script>\r\n" + //" debugger;\r\n"+
" var $ = window.parent.jQuery,\r\n" +
" ff = $ ? $.signalR.transports.foreverFrame : null,\r\n" +
@@ -17,7 +18,8 @@ public class ForeverFrameTransport : ForeverTransport
private const string _initSuffix = "') : null,\r\n" +
" r = ff ? ff.receive : function() {};\r\n" +
" ff ? ff.started(c) : '';" +
- "</script>";
+ "</script></head>" +
+ "<body>\r\n";
private readonly bool _isDebug;
View
14 samples/SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js
@@ -933,7 +933,19 @@
transportLogic.ajaxSend(connection, data);
},
- receive: transportLogic.processMessages,
+ receive: function (connection, data) {
+ var cw;
+ transportLogic.processMessages(connection, data);
+ // Delete the script & div elements
+ connection.frameMessageCount = (connection.frameMessageCount || 0) + 1;
+ if (connection.frameMessageCount > 50) {
+ connection.frameMessageCount = 0;
+ cw = connection.frame.contentWindow || connection.frame.contentDocument;
+ if (cw && cw.document) {
+ $("body", cw.document).empty();
+ }
+ }
+ },
stop: function (connection) {
var cw = null;
View
2  samples/SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.min.js
@@ -6,4 +6,4 @@
* Licensed under the MIT.
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md
*/
-(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:u.processMessages,stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
+(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:function(t,i){var r;u.processMessages(t,i),t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>50&&(t.frameMessageCount=0,r=t.frame.contentWindow||t.frame.contentDocument,r&&r.document&&n("body",r.document).empty())},stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
View
14 samples/SignalR.Hosting.Owin.Samples/Content/Scripts/jquery.signalR.js
@@ -933,7 +933,19 @@
transportLogic.ajaxSend(connection, data);
},
- receive: transportLogic.processMessages,
+ receive: function (connection, data) {
+ var cw;
+ transportLogic.processMessages(connection, data);
+ // Delete the script & div elements
+ connection.frameMessageCount = (connection.frameMessageCount || 0) + 1;
+ if (connection.frameMessageCount > 50) {
+ connection.frameMessageCount = 0;
+ cw = connection.frame.contentWindow || connection.frame.contentDocument;
+ if (cw && cw.document) {
+ $("body", cw.document).empty();
+ }
+ }
+ },
stop: function (connection) {
var cw = null;
View
2  samples/SignalR.Hosting.Owin.Samples/Content/Scripts/jquery.signalR.min.js
@@ -6,4 +6,4 @@
* Licensed under the MIT.
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md
*/
-(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:u.processMessages,stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
+(function(n,t){"use strict";var u;if(typeof n!="function")throw"SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.";if(!t.JSON)throw"SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";var i,o,r={onStart:"onStart",onStarting:"onStarting",onSending:"onSending",onReceived:"onReceived",onError:"onError",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},h=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},s=function(i){var r;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=t.document.createElement("a"),r.href=i,r.protocol+r.host!==t.location.protocol+t.location.host)},f=function(t,i){i!==t.state&&(n(t).trigger(r.onStateChanged,[{oldState:t.state,newState:i}]),t.state=i)},e=function(n){return n.state===i.connectionState.disconnecting||n.state===i.connectionState.disconnected};i=function(n,t,r){return new i.fn.init(n,t,r)},i.connectionState={connecting:0,connected:1,reconnecting:2,disconnecting:3,disconnected:4},i.fn=i.prototype={init:function(n,t,i){this.url=n,this.qs=t,typeof i=="boolean"&&(this.logging=i)},ajaxDataType:"json",logging:!1,state:i.connectionState.disconnected,reconnectDelay:2e3,start:function(u,e){var o=this,h={transport:"auto",jsonp:!1},a,c=n.Deferred(),l=t.document.createElement("a");return o.state===i.connectionState.connecting||o.state===i.connectionState.connected?(c.resolve(o),c.promise()):(f(o,i.connectionState.connecting),n.type(u)==="function"?e=u:n.type(u)==="object"&&(n.extend(h,u),n.type(h.callback)==="function"&&(e=h.callback)),l.href=o.url,o.baseUrl=l.protocol===":"?t.document.location.protocol+"//"+t.document.location.host:l.protocol+"//"+l.host,s(o.url)&&(o.log("Auto detected cross domain url."),h.transport==="auto"&&(h.jsonp||(h.jsonp=!n.support.cors,h.jsonp&&o.log("Using jsonp because this browser doesn't support CORS")),h.transport=h.jsonp===!0?"longPolling":["webSockets","longPolling"])),o.ajaxDataType=h.jsonp?"jsonp":"json",n(o).bind(r.onStart,function(){n.type(e)==="function"&&e.call(o),c.resolve(o)}),a=function(u,e){if(e=e||0,e>=u.length){o.transport||c.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.");return}var s=u[e],h=n.type(s)==="object"?s:i.transports[s];h.start(o,function(){o.transport=h,f(o,i.connectionState.connected),n(o).trigger(r.onStart),n(t).unload(function(){o.stop(!1)})},function(){a(u,e+1)})},t.setTimeout(function(){var t=o.url+"/negotiate";o.log("Negotiating with '"+t+"'."),n.ajax({url:t,global:!1,cache:!1,type:"GET",data:{},dataType:o.ajaxDataType,error:function(t){n(o).trigger(r.onError,[t.responseText]),c.reject("SignalR: Error during negotiation request: "+t),o.stop()},success:function(t){if(o.appRelativeUrl=t.Url,o.id=t.ConnectionId,o.webSocketServerUrl=t.WebSocketServerUrl,!t.ProtocolVersion||t.ProtocolVersion!=="1.0"){n(o).trigger(r.onError,"SignalR: Incompatible protocol version."),c.reject("SignalR: Incompatible protocol version.");return}n(o).trigger(r.onStarting);var f=[],u=[];n.each(i.transports,function(n){if(n==="webSockets"&&!t.TryWebSockets)return!0;u.push(n)}),n.isArray(h.transport)?n.each(h.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,u)>=0)&&f.push(n.type(t)==="string"?""+t:t)}):n.type(h.transport)==="object"||n.inArray(h.transport,u)>=0?f.push(h.transport):f=u,a(f)}})},0),c.promise())},starting:function(t){var i=this,u=n(i);return u.bind(r.onStarting,function(){t.call(i),u.unbind(r.onStarting)}),i},send:function(n){var t=this;if(!t.transport)throw"SignalR: Connection must be started before data can be sent. Call .start() before .send()";return t.transport.send(t,n),t},sending:function(t){var i=this;return n(i).bind(r.onSending,function(){t.call(i)}),i},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(t){var u=this;if(u.state!==i.connectionState.disconnecting&&u.state!==i.connectionState.disconnected){try{f(u,i.connectionState.disconnecting),u.transport&&(u.transport.abort(u,t),u.transport.stop(u),u.transport=null),n(u).trigger(r.onDisconnect),delete u.messageId,delete u.groups}finally{f(u,i.connectionState.disconnected)}return u}},log:function(n){h(n,this.logging)}},i.fn.init.prototype=i.fn,u={addQs:function(i,r){return r.qs?typeof r.qs=="object"?i+"&"+n.param(r.qs):typeof r.qs=="string"?i+"&"+r.qs:i+"&"+t.escape(r.qs.toString()):i},getUrl:function(n,i,r,u){var o=i==="webSockets"?"":n.baseUrl,f=o+n.appRelativeUrl,e="transport="+i+"&connectionId="+t.escape(n.id);return n.data&&(e+="&connectionData="+t.escape(n.data)),r?(u&&(f=f+"/reconnect"),n.messageId&&(e+="&messageId="+n.messageId),n.groups&&(e+="&groups="+t.escape(JSON.stringify(n.groups)))):f=f+"/connect",f+="?"+e,f=this.addQs(f,n)},ajaxSend:function(i,u){var f=i.url+"/send?transport="+i.transport.name+"&connectionId="+t.escape(i.id);f=this.addQs(f,i),n.ajax({url:f,global:!1,type:"POST",dataType:i.ajaxDataType,data:{data:u},success:function(t){t&&n(i).trigger(r.onReceived,[t])},error:function(t,u){u!=="abort"&&(u!=="parsererror"||i.ajaxDataType!=="jsonp")&&n(i).trigger(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionId="+t.escape(i.id);u=this.addQs(u,i),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},processMessages:function(t,i){var u=n(t);if(i){if(i.Disconnect){t.log("Disconnect command received from server"),t.stop();return}i.Messages&&n.each(i.Messages,function(){try{u.trigger(r.onReceived,[this])}catch(i){t.log("Error raising received "+i),n(t).trigger(r.onError,[i])}}),i.MessageId&&(t.messageId=i.MessageId),i.TransportData&&(t.groups=i.TransportData.Groups)}},foreverFrame:{count:0,connections:{}}},i.transports={webSockets:{name:"webSockets",send:function(n,t){n.socket.send(t)},start:function(e,o,s){var c,a=!1,v=this,y=!o,l,h;if(t.MozWebSocket&&(t.WebSocket=t.MozWebSocket),!t.WebSocket){s();return}e.socket||(e.webSocketServerUrl?c=e.webSocketServerUrl:(h=document.location,h.protocol!=="http:"&&h.protocol!=="https:"&&(h=t.document.createElement("a"),h.href=e.url),l=h.protocol==="https:"?"wss://":"ws://",c=l+h.host),n(e).trigger(r.onSending),c+=u.getUrl(e,this.name,y),e.log("Connecting to websocket endpoint '"+c+"'"),e.socket=new t.WebSocket(c),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),o?o():f(e,i.connectionState.connected)},e.socket.onclose=function(t){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).trigger(r.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s&&s();return}f(e,i.connectionState.reconnecting),v.stop(e),v.start(e)},e.socket.onmessage=function(i){var f=t.JSON.parse(i.data),o;f&&(o=n(e),f.Messages?u.processMessages(e,f):o.trigger(r.onReceived,[f]))})},stop:function(n){n.socket!==null&&(n.socket.close(),n.socket=null)},abort:function(){}},serverSentEvents:{name:"serverSentEvents",timeOut:3e3,start:function(o,s,h){var c=this,v=!1,a=n(o),l=!s,p,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}a.trigger(r.onSending),p=u.getUrl(o,this.name,l);try{o.log("Attempting to connect to SSE endpoint '"+p+"'"),o.eventSource=new t.EventSource(p)}catch(w){o.log("EventSource failed trying to connect with error "+w.Message),h?h():(a.trigger(r.onError,[w]),l&&(o.log("EventSource reconnecting"),e(o)===!1&&c.reconnect(o)));return}y=t.setTimeout(function(){v===!1&&(o.log("EventSource timed out trying to connect"),o.log("EventSource readyState: "+o.eventSource.readyState),h&&h(),l?o.eventSource.readyState!==t.EventSource.CONNECTING&&o.eventSource.readyState!==t.EventSource.OPEN&&(o.log("EventSource reconnecting"),c.reconnect(o)):(o.log("EventSource stopping the connection."),c.stop(o)))},c.timeOut),o.eventSource.addEventListener("open",function(){o.log("EventSource connected"),y&&t.clearTimeout(y),v===!1&&(v=!0,s&&s(),l&&(a.trigger(r.onReconnect),f(o,i.connectionState.connected)))},!1),o.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&u.processMessages(o,t.JSON.parse(n.data))},!1),o.eventSource.addEventListener("error",function(n){if(!v){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending"),f(o,i.connectionState.reconnecting),e(o)===!1&&c.reconnect(o)):(o.log("EventSource error"),a.trigger(r.onError))},!1)},reconnect:function(n){var i=this;t.setTimeout(function(){i.stop(n),i.start(n)},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n&&n.eventSource&&(n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){u.ajaxAbort(n,t)}},foreverFrame:{name:"foreverFrame",timeOut:3e3,start:function(o,s,h){var l=this,a=u.foreverFrame.count+=1,v,y,c=n("<iframe data-signalr-connection-id='"+o.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;'></iframe>");if(t.EventSource){h&&(o.log("This brower supports SSE, skipping Forever Frame."),h());return}n(o).trigger(r.onSending),v=u.getUrl(o,this.name),v+="&frameId="+a,c.prop("src",v),u.foreverFrame.connections[a]=o,o.log("Binding to iframe's readystatechange event."),c.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(o.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),e(o)===!1&&(f(o,i.connectionState.reconnecting),l.reconnect(o)))}),o.frame=c[0],o.frameId=a,s&&(o.onSuccess=s),n("body").append(c),y=t.setTimeout(function(){o.onSuccess&&(o.log("Failed to connect using forever frame source, it timed out after "+l.timeOut+"ms."),l.stop(o),h&&h())},l.timeOut)},reconnect:function(n){var i=this;t.setTimeout(function(){if(n.frame){var r=n.frame,t=u.getUrl(n,i.name,!0)+"&frameId="+n.frameId;n.log("Upating iframe src to '"+t+"'."),r.src=t}},n.reconnectDelay)},send:function(n,t){u.ajaxSend(n,t)},receive:function(t,i){var r;u.processMessages(t,i),t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>50&&(t.frameMessageCount=0,r=t.frame.contentWindow||t.frame.contentDocument,r&&r.document&&n("body",r.document).empty())},stop:function(t){var i=null;t.frame&&(t.frame.stop?t.frame.stop():(i=t.frame.contentWindow||t.frame.contentDocument,i.document&&i.document.execCommand&&i.document.execCommand("Stop")),n(t.frame).remove(),delete u.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,t.log("Stopping forever frame"))},abort:function(n,t){u.ajaxAbort(n,t)},getConnection:function(n){return u.foreverFrame.connections[n]},started:function(t){t.onSuccess?(t.onSuccess(),t.onSuccess=null,delete t.onSuccess):(n(t).trigger(r.onReconnect),f(t,i.connectionState.connected))}},longPolling:{name:"longPolling",reconnectDelay:3e3,start:function(o,s){var l=this,c=!1;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function h(a,v){n(a).trigger(r.onSending);var d=a.messageId,k=d===null,b=!k,w=u.getUrl(a,l.name,b,v),p=null,y=!1;b===!0&&v===!0&&f(o,i.connectionState.reconnecting),o.log("Attempting to connect to '"+w+"' using longPolling."),a.pollXhr=n.ajax({url:w,global:!1,type:"GET",dataType:o.ajaxDataType,success:function(l){var w=0,p=!1;(c==!1&&(s(),c=!0),v===!0&&y===!1&&(o.log("Raising the reconnect event"),f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0),u.processMessages(a,l),l&&l.TransportData&&n.type(l.TransportData.LongPollDelay)==="number"&&(w=l.TransportData.LongPollDelay),l&&l.TimedOut&&(p=l.TimedOut),l&&l.Disconnect)||e(a)!==!0&&(w>0?t.setTimeout(function(){h(a,p)},w):h(a,p))},error:function(i,u){if(u==="abort"){o.log("Aborted xhr requst.");return}o.log("An error occurred using longPolling. Status = "+u+". "+i.responseText),p&&clearTimeout(p),n(a).trigger(r.onError,[i.responseText]),t.setTimeout(function(){e(a)===!1&&h(a,!0)},o.reconnectDelay)}}),v===!0&&(p=t.setTimeout(function(){y===!1&&(f(o,i.connectionState.connected),n(a).trigger(r.onReconnect),y=!0)},l.reconnectDelay))})(o),t.setTimeout(function(){c===!1&&(s(),c=!0)},150)},250)},send:function(n,t){u.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){u.ajaxAbort(n,t)}}},i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window)
Please sign in to comment.
Something went wrong with that request. Please try again.