Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed use of ConcurrentDictionary in .NET client.

- Just use a regular dictionary with locks.
- Remove dependency on tasks package.
- Removed silverlight 4 project.
- Removed core project and client project from SL solution.
  • Loading branch information...
commit b0f7b140e9f8b39b19f48234f12291ae8886a1ae 1 parent 91e4f61
@davidfowl davidfowl authored
View
22 Microsoft.AspNet.SignalR.Silverlight.sln
@@ -1,18 +1,12 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SignalR.Core", "src\Microsoft.AspNet.SignalR.Core\Microsoft.AspNet.SignalR.Core.csproj", "{1B9A82C4-BCA1-4834-A33E-226F17BE070B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SignalR.Client", "src\Microsoft.AspNet.SignalR.Client\Microsoft.AspNet.SignalR.Client.csproj", "{EB46B9C6-EE37-48F9-835E-E49580E40E0A}"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{1E4BA77C-4977-40AA-B297-3A2CB9990ABF}"
ProjectSection(SolutionItems) = preProject
Build\Build.proj = Build\Build.proj
ReleaseNotes.md = ReleaseNotes.md
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SignalR.Client.Silverlight", "src\Microsoft.AspNet.SignalR.Client.Silverlight\Microsoft.AspNet.SignalR.Client.Silverlight.csproj", "{C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.SignalR.Client.Silverlight5", "src\Microsoft.AspNet.SignalR.Client.Silverlight5\Microsoft.AspNet.SignalR.Client.Silverlight5.csproj", "{0220B607-1686-4D4A-AEF0-292EA9827531}"
EndProject
Global
@@ -21,18 +15,6 @@ Global
Release|Any CPU = Release|Any CPU
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}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1B9A82C4-BCA1-4834-A33E-226F17BE070B}.Release|Any CPU.Build.0 = 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}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EB46B9C6-EE37-48F9-835E-E49580E40E0A}.Release|Any CPU.Build.0 = Release|Any CPU
- {C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}.Release|Any CPU.Build.0 = Release|Any CPU
{0220B607-1686-4D4A-AEF0-292EA9827531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0220B607-1686-4D4A-AEF0-292EA9827531}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0220B607-1686-4D4A-AEF0-292EA9827531}.Release|Any CPU.ActiveCfg = Release|Any CPU
View
226 ...soft.AspNet.SignalR.Client.Silverlight/Microsoft.AspNet.SignalR.Client.Silverlight.csproj
@@ -1,226 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{C55F7A30-5F93-4837-A13A-8DA06C8A2A3C}</ProjectGuid>
- <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Microsoft.AspNet.SignalR.Client.Silverlight</RootNamespace>
- <AssemblyName>Microsoft.AspNet.SignalR.Client.Silverlight</AssemblyName>
- <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
- <SilverlightApplication>false</SilverlightApplication>
- <ValidateXaml>true</ValidateXaml>
- <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
- <RestorePackages>true</RestorePackages>
- <DisableSigning>true</DisableSigning>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- </PropertyGroup>
- <!-- This property group is only here to support building this project using the
- MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
- to set the TargetFrameworkVersion to v3.5 -->
- <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>Bin\Debug</OutputPath>
- <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
- <NoStdLib>true</NoStdLib>
- <NoConfig>true</NoConfig>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <DocumentationFile>Bin\Debug\Microsoft.AspNet.SignalR.Client.Silverlight.XML</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>Bin\Release</OutputPath>
- <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
- <NoStdLib>true</NoStdLib>
- <NoConfig>true</NoConfig>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <DocumentationFile>Bin\Release\Microsoft.AspNet.SignalR.Client.Silverlight.XML</DocumentationFile>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="mscorlib" />
- <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\..\packages\Newtonsoft.Json.4.5.4\lib\sl4\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="System.Threading.Tasks.SL4">
- <HintPath>..\..\packages\System.Threading.Tasks.2.1.2\lib\sl40\System.Threading.Tasks.SL4.dll</HintPath>
- </Reference>
- <Reference Include="System.Windows" />
- <Reference Include="system" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Net" />
- <Reference Include="System.Windows.Browser" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\Common\CommonAssemblyInfo.cs">
- <Link>Properties\CommonAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="..\Common\CommonVersionInfo.cs">
- <Link>Properties\CommonVersionInfo.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Connection.cs">
- <Link>Connection.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\ConnectionExtensions.cs">
- <Link>ConnectionExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\ConnectionState.cs">
- <Link>ConnectionState.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\ExceptionHelper.cs">
- <Link>Infrastructure\ExceptionHelper.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Resources.Designer.cs">
- <Link>Resources.Designer.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\StateChange.cs">
- <Link>StateChange.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\DefaultHttpClient.cs">
- <Link>Http\DefaultHttpClient.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\HttpHelper.cs">
- <Link>Http\HttpHelper.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\HttpWebRequestWrapper.cs">
- <Link>Http\HttpWebRequestWrapper.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\HttpWebResponseWrapper.cs">
- <Link>Http\HttpWebResponseWrapper.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\IHttpClient.cs">
- <Link>Http\IHttpClient.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\IHttpClientExtensions.cs">
- <Link>Http\IHttpClientExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\IRequest.cs">
- <Link>Http\IRequest.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Http\IResponse.cs">
- <Link>Http\IResponse.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubConnection.cs">
- <Link>Hubs\HubConnection.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubProxy.cs">
- <Link>Hubs\HubProxy.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubProxyExtensions.cs">
- <Link>Hubs\HubProxyExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubRegistrationData.cs">
- <Link>Hubs\HubRegistrationData.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubResult.cs">
- <Link>Hubs\HubResult.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\HubInvocation.cs">
- <Link>Hubs\HubInvocation.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\IHubProxy.cs">
- <Link>Hubs\IHubProxy.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Hubs\Subscription.cs">
- <Link>Hubs\Subscription.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\IConnection.cs">
- <Link>IConnection.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\DisposableAction.cs">
- <Link>Infrastructure\DisposableAction.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\ThreadSafeInvoker.cs">
- <Link>Infrastructure\ThreadSafeInvoker.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\StreamExtensions.cs">
- <Link>Infrastructure\StreamExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\NegotiationResponse.cs">
- <Link>NegotiationResponse.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\AutoTransport.cs">
- <Link>Transports\AutoTransport.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\HttpBasedTransport.cs">
- <Link>Transports\HttpBasedTransport.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\IClientTransport.cs">
- <Link>Transports\IClientTransport.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\LongPollingTransport.cs">
- <Link>Transports\LongPollingTransport.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\ServerSentEventsTransport.cs">
- <Link>Transports\ServerSentEventsTransport.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\ServerSentEvents\ChunkBuffer.cs">
- <Link>Transports\ServerSentEvents\ChunkBuffer.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\ServerSentEvents\EventSourceStreamReader.cs">
- <Link>Transports\ServerSentEvents\EventSourceStreamReader.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\ServerSentEvents\EventType.cs">
- <Link>Transports\ServerSentEvents\EventType.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Transports\ServerSentEvents\SseEvent.cs">
- <Link>Transports\ServerSentEvents\SseEvent.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Core\Infrastructure\ExceptionsExtensions.cs">
- <Link>Infrastructure\ExceptionsExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Core\TaskAsyncHelper.cs">
- <Link>Infrastructure\TaskAsyncHelper.cs</Link>
- </Compile>
- <Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\UrlEncoder.cs">
- <Link>Infrastructure\UrlEncoder.cs</Link>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config">
- <SubType>Designer</SubType>
- </None>
- <None Include="Properties\Microsoft.AspNet.SignalR.Client.Silverlight.nuspec">
- <SubType>Designer</SubType>
- </None>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="..\Microsoft.AspNet.SignalR.Client\Resources.resx">
- <LogicalName>Microsoft.AspNet.SignalR.Client.Resources.resources</LogicalName>
- <Link>Resources.resx</Link>
- </EmbeddedResource>
- </ItemGroup>
- <Import Project="..\Common\Microsoft.AspNet.SignalR.targets" />
- <Import Project="$(LocalToolsPath)\Silverlight\v4.0\SignalR.Silverlight.targets" Condition="'$(LocalToolsPath)'!=''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(LocalToolsPath)' == '' And Exists('$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets')" />
- <Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
- <SilverlightProjectProperties />
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
6 src/Microsoft.AspNet.SignalR.Client.Silverlight/Properties/AssemblyInfo.cs
@@ -1,6 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
-
-using System.Reflection;
-
-[assembly: AssemblyTitle("Microsoft.AspNet.SignalR.Client.Silverlight")]
-[assembly: AssemblyDescription("Silverlight client for SignalR")]
View
13 ....SignalR.Client.Silverlight/Properties/Microsoft.AspNet.SignalR.Client.Silverlight.nuspec
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<package >
- <metadata>
- <id>$id$</id>
- <version>$version$</version>
- <title>$title$</title>
- <authors>$author$</authors>
- <licenseUrl>https://github.com/SignalR/SignalR/blob/master/LICENSE.md</licenseUrl>
- <projectUrl>https://github.com/SignalR/SignalR</projectUrl>
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
- <description>$description$</description>
- </metadata>
-</package>
View
5 src/Microsoft.AspNet.SignalR.Client.Silverlight/packages.config
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Newtonsoft.Json" version="4.5.4" />
- <package id="System.Threading.Tasks" version="2.1.2" />
-</packages>
View
4 ...ft.AspNet.SignalR.Client.Silverlight5/Microsoft.AspNet.SignalR.Client.Silverlight5.csproj
@@ -55,10 +55,6 @@
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.4.5.4\lib\sl4\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="System.Threading.Tasks.SL5, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\System.Threading.Tasks.3.0.1\lib\sl50\System.Threading.Tasks.SL5.dll</HintPath>
- </Reference>
<Reference Include="System.Windows" />
<Reference Include="system" />
<Reference Include="System.Core" />
View
1  src/Microsoft.AspNet.SignalR.Client.Silverlight5/packages.config
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="4.5.4" />
- <package id="System.Threading.Tasks" version="3.0.1" />
</packages>
View
3  src/Microsoft.AspNet.SignalR.Client/Connection.cs
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
@@ -109,7 +108,7 @@ public Connection(string url, string queryString)
Url = url;
QueryString = queryString;
_groups = new HashSet<string>();
- Items = new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase);
+ Items = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
State = ConnectionState.Disconnected;
}
View
9 src/Microsoft.AspNet.SignalR.Client/ConnectionExtensions.cs
@@ -19,10 +19,13 @@ public static T GetValue<T>(this IConnection connection, string key)
throw new ArgumentNullException("key");
}
- object value;
- if (connection.Items.TryGetValue(key, out value))
+ lock (connection.Items)
{
- return (T)value;
+ object value;
+ if (connection.Items.TryGetValue(key, out value))
+ {
+ return (T)value;
+ }
}
return default(T);
View
5 src/Microsoft.AspNet.SignalR.Client/Transports/HttpBasedTransport.cs
@@ -154,7 +154,10 @@ protected virtual Action<IRequest> PrepareRequest(IConnection connection)
// Setup the user agent along with any other defaults
connection.PrepareRequest(request);
- connection.Items[HttpRequestKey] = request;
+ lock (connection.Items)
+ {
+ connection.Items[HttpRequestKey] = request;
+ }
};
}
View
7 src/Microsoft.AspNet.SignalR.Client/Transports/LongPollingTransport.cs
@@ -79,8 +79,11 @@ private void PollingLoop(IConnection connection, string data, Action initializeC
HttpClient.PostAsync(url, PrepareRequest(connection)).ContinueWith(task =>
{
- // Clear the pending request
- connection.Items.Remove(HttpRequestKey);
+ lock (connection.Items)
+ {
+ // Clear the pending request
+ connection.Items.Remove(HttpRequestKey);
+ }
bool shouldRaiseReconnect = false;
bool disconnectedReceived = false;
View
5 src/Microsoft.AspNet.SignalR.Client/Transports/ServerSentEventsTransport.cs
@@ -107,7 +107,10 @@ private void OpenConnection(IConnection connection, string data, Action initiali
var eventSource = new EventSourceStreamReader(stream);
bool retry = true;
- connection.Items[EventSourceKey] = eventSource;
+ lock (connection.Items)
+ {
+ connection.Items[EventSourceKey] = eventSource;
+ }
eventSource.Opened = () =>
{
Please sign in to comment.
Something went wrong with that request. Please try again.