Skip to content
Browse files

Moved more stuff in and out of the core namespaces.

  • Loading branch information...
1 parent 124d473 commit 524e606e7f9f18e8a7b40d62d590c904a94eb30e @davidfowl davidfowl committed Dec 21, 2012
Showing with 115 additions and 87 deletions.
  1. +2 −1 samples/Microsoft.AspNet.Owin.Samples/Hubs/Chat.cs
  2. +1 −0 src/Microsoft.AspNet.SignalR.Core/Connection.cs
  3. +0 −41 src/Microsoft.AspNet.SignalR.Core/{Infrastructure → }/DependencyResolverExtensions.cs
  4. +2 −1 src/Microsoft.AspNet.SignalR.Core/{Hubs → }/Hub.cs
  5. 0 src/Microsoft.AspNet.SignalR.Core/{Infrastructure → }/IDependencyResolver.cs
  6. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/AckHandler.cs
  7. +2 −21 src/Microsoft.AspNet.SignalR.Core/Infrastructure/ConnectionExtensions.cs
  8. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/DiffPair.cs
  9. +1 −2 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/DiffSet.cs
  10. 0 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/EmptyConnectionIdPrefixGenerator.cs
  11. +49 −0 src/Microsoft.AspNet.SignalR.Core/Infrastructure/HostDependencyResolverExtensions.cs
  12. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/IAckHandler.cs
  13. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/PersistentConnectionContext.cs
  14. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Infrastructure}/PersistentConnectionFactory.cs
  15. 0 src/Microsoft.AspNet.SignalR.Core/{ → MessageBus}/Command.cs
  16. 0 src/Microsoft.AspNet.SignalR.Core/{ → MessageBus}/CommandType.cs
  17. +15 −13 src/Microsoft.AspNet.SignalR.Core/Microsoft.AspNet.SignalR.Core.csproj
  18. +1 −0 src/Microsoft.AspNet.SignalR.Core/Transports/ITransport.cs
  19. +1 −1 src/Microsoft.AspNet.SignalR.Core/{ → Transports}/ITransportConnection.cs
  20. +0 −1 src/Microsoft.AspNet.SignalR.Core/Transports/LongPollingTransport.cs
  21. +27 −0 src/Microsoft.AspNet.SignalR.Core/Transports/TransportConnectionExtensions.cs
  22. +1 −0 src/Microsoft.AspNet.SignalR.Hosting.Memory/Routing/RouteManager.cs
  23. +1 −0 src/Microsoft.AspNet.SignalR.Owin/Handlers/PersistentConnectionHandler.cs
  24. +1 −0 src/Microsoft.AspNet.SignalR.Owin/OwinExtensions.cs
  25. +1 −0 src/Microsoft.AspNet.SignalR.Stress/ConnectionRun.cs
  26. +2 −1 src/Microsoft.AspNet.SignalR.SystemWeb/RouteExtensions.cs
  27. +1 −0 tests/Microsoft.AspNet.SignalR.Tests/PersistentConnectionFactoryFacts.cs
  28. +1 −0 tests/Microsoft.AspNet.SignalR.Tests/Server/AckHandlerFacts.cs
  29. +1 −0 tests/Microsoft.AspNet.SignalR.Tests/Server/DiffSetFacts.cs
View
3 samples/Microsoft.AspNet.Owin.Samples/Hubs/Chat.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNet.SignalR.Hubs;
+using Microsoft.AspNet.SignalR;
+using Microsoft.AspNet.SignalR.Hubs;
namespace Microsoft.AspNet.Owin.Samples.Hubs
{
View
1 src/Microsoft.AspNet.SignalR.Core/Connection.cs
@@ -8,6 +8,7 @@
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Infrastructure;
using Microsoft.AspNet.SignalR.Json;
+using Microsoft.AspNet.SignalR.Transports;
namespace Microsoft.AspNet.SignalR
{
View
41 ...structure/DependencyResolverExtensions.cs → ...nalR.Core/DependencyResolverExtensions.cs
@@ -59,46 +59,5 @@ public static IEnumerable<object> ResolveAll(this IDependencyResolver resolver,
return resolver.GetServices(type);
}
-
- public static void InitializeHost(this IDependencyResolver resolver, string instanceName, CancellationToken hostShutdownToken)
- {
- if (resolver == null)
- {
- throw new ArgumentNullException("resolver");
- }
-
- if (String.IsNullOrEmpty(instanceName))
- {
- throw new ArgumentNullException("instanceName");
- }
-
- // Initialize the performance counters
- resolver.InitializePerformanceCounters(instanceName, hostShutdownToken);
-
- // Dispose the dependency resolver on host shut down (cleanly)
- resolver.InitializeResolverDispose(hostShutdownToken);
- }
-
- private static void InitializePerformanceCounters(this IDependencyResolver resolver, string instanceName, CancellationToken hostShutdownToken)
- {
- var counters = resolver.Resolve<IPerformanceCounterManager>();
- if (counters != null)
- {
- counters.Initialize(instanceName, hostShutdownToken);
- }
- }
-
- private static void InitializeResolverDispose(this IDependencyResolver resolver, CancellationToken hostShutdownToken)
- {
- // TODO: Guard against multiple calls to this
-
- // When the host triggers the shutdown token, dispose the resolver
- hostShutdownToken.Register(state =>
- {
- ((IDependencyResolver)state).Dispose();
- },
- resolver,
- useSynchronizationContext: false);
- }
}
}
View
3 ...Microsoft.AspNet.SignalR.Core/Hubs/Hub.cs → src/Microsoft.AspNet.SignalR.Core/Hub.cs
@@ -4,8 +4,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Hubs;
-namespace Microsoft.AspNet.SignalR.Hubs
+namespace Microsoft.AspNet.SignalR
{
/// <summary>
/// Provides methods that communicate with SignalR connections that connected to a <see cref="Hub"/>.
View
0 ...ore/Infrastructure/IDependencyResolver.cs → ...spNet.SignalR.Core/IDependencyResolver.cs
File renamed without changes.
View
2 ...crosoft.AspNet.SignalR.Core/AckHandler.cs → ...SignalR.Core/Infrastructure/AckHandler.cs
@@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal class AckHandler : IAckHandler, IDisposable
{
View
23 src/Microsoft.AspNet.SignalR.Core/Infrastructure/ConnectionExtensions.cs
@@ -2,31 +2,12 @@
using System;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Transports;
namespace Microsoft.AspNet.SignalR
{
public static class ConnectionExtensions
- {
- internal static Task Close(this ITransportConnection connection, string connectionId)
- {
- var command = new Command
- {
- CommandType = CommandType.Disconnect
- };
-
- return connection.Send(new ConnectionMessage(connectionId, command));
- }
-
- internal static Task Abort(this ITransportConnection connection, string connectionId)
- {
- var command = new Command
- {
- CommandType = CommandType.Abort
- };
-
- return connection.Send(new ConnectionMessage(connectionId, command));
- }
-
+ {
/// <summary>
/// Sends a message to all connections subscribed to the specified signal. An example of signal may be a
/// specific connection id, or fully qualified group name (Use <see cref="IGroupManager"/> to manipulate groups).
View
2 ...Microsoft.AspNet.SignalR.Core/DiffPair.cs → ...t.SignalR.Core/Infrastructure/DiffPair.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal struct DiffPair<T>
{
View
3 src/Microsoft.AspNet.SignalR.Core/DiffSet.cs → ...et.SignalR.Core/Infrastructure/DiffSet.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
-using Microsoft.AspNet.SignalR.Infrastructure;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal class DiffSet<T>
{
View
0 ....Core/EmptyConnectionIdPrefixGenerator.cs → ...cture/EmptyConnectionIdPrefixGenerator.cs
File renamed without changes.
View
49 src/Microsoft.AspNet.SignalR.Core/Infrastructure/HostDependencyResolverExtensions.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Threading;
+
+namespace Microsoft.AspNet.SignalR.Infrastructure
+{
+ public static class HostDependencyResolverExtensions
+ {
+ public static void InitializeHost(this IDependencyResolver resolver, string instanceName, CancellationToken hostShutdownToken)
+ {
+ if (resolver == null)
+ {
+ throw new ArgumentNullException("resolver");
+ }
+
+ if (String.IsNullOrEmpty(instanceName))
+ {
+ throw new ArgumentNullException("instanceName");
+ }
+
+ // Initialize the performance counters
+ resolver.InitializePerformanceCounters(instanceName, hostShutdownToken);
+
+ // Dispose the dependency resolver on host shut down (cleanly)
+ resolver.InitializeResolverDispose(hostShutdownToken);
+ }
+
+ private static void InitializePerformanceCounters(this IDependencyResolver resolver, string instanceName, CancellationToken hostShutdownToken)
+ {
+ var counters = resolver.Resolve<IPerformanceCounterManager>();
+ if (counters != null)
+ {
+ counters.Initialize(instanceName, hostShutdownToken);
+ }
+ }
+
+ private static void InitializeResolverDispose(this IDependencyResolver resolver, CancellationToken hostShutdownToken)
+ {
+ // TODO: Guard against multiple calls to this
+
+ // When the host triggers the shutdown token, dispose the resolver
+ hostShutdownToken.Register(state =>
+ {
+ ((IDependencyResolver)state).Dispose();
+ },
+ resolver,
+ useSynchronizationContext: false);
+ }
+ }
+}
View
2 ...rosoft.AspNet.SignalR.Core/IAckHandler.cs → ...ignalR.Core/Infrastructure/IAckHandler.cs
@@ -4,7 +4,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
public interface IAckHandler
{
View
2 ...gnalR.Core/PersistentConnectionContext.cs → ...astructure/PersistentConnectionContext.cs
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal class PersistentConnectionContext : IPersistentConnectionContext
{
View
2 ...gnalR.Core/PersistentConnectionFactory.cs → ...astructure/PersistentConnectionFactory.cs
@@ -3,7 +3,7 @@
using System;
using System.Globalization;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Infrastructure
{
/// <summary>
/// Responsible for creating <see cref="PersistentConnection"/> instances.
View
0 src/Microsoft.AspNet.SignalR.Core/Command.cs → ...AspNet.SignalR.Core/MessageBus/Command.cs
File renamed without changes.
View
0 ...rosoft.AspNet.SignalR.Core/CommandType.cs → ...et.SignalR.Core/MessageBus/CommandType.cs
File renamed without changes.
View
28 src/Microsoft.AspNet.SignalR.Core/Microsoft.AspNet.SignalR.Core.csproj
@@ -53,12 +53,12 @@
<Compile Include="..\Microsoft.AspNet.SignalR.Client\Infrastructure\StreamExtensions.cs">
<Link>Infrastructure\StreamExtensions.cs</Link>
</Compile>
- <Compile Include="AckHandler.cs" />
+ <Compile Include="Infrastructure\AckHandler.cs" />
<Compile Include="Configuration\DefaultConfigurationManager.cs" />
<Compile Include="ConnectionManager.cs" />
<Compile Include="ConnectionMessage.cs" />
- <Compile Include="DiffPair.cs" />
- <Compile Include="DiffSet.cs" />
+ <Compile Include="Infrastructure\DiffPair.cs" />
+ <Compile Include="Infrastructure\DiffSet.cs" />
<Compile Include="GlobalHost.cs" />
<Compile Include="Hosting\HostConstants.cs" />
<Compile Include="Hosting\HostContext.cs" />
@@ -67,7 +67,8 @@
<Compile Include="Hosting\IWebSocketRequest.cs" />
<Compile Include="Hosting\IRequest.cs" />
<Compile Include="Hosting\IResponse.cs" />
- <Compile Include="CommandType.cs" />
+ <Compile Include="Infrastructure\HostDependencyResolverExtensions.cs" />
+ <Compile Include="MessageBus\CommandType.cs" />
<Compile Include="Hosting\IWebSocket.cs" />
<Compile Include="Hosting\ResponseExtensions.cs" />
<Compile Include="Hubs\HubConnectionContext.cs" />
@@ -96,7 +97,7 @@
<Compile Include="Hubs\Lookup\Descriptors\Descriptor.cs" />
<Compile Include="Hubs\Pipeline\Auth\NotAuthorizedException.cs" />
<Compile Include="Hubs\StateChangeTracker.cs" />
- <Compile Include="IAckHandler.cs" />
+ <Compile Include="Infrastructure\IAckHandler.cs" />
<Compile Include="Hubs\Pipeline\HubPipeline.cs" />
<Compile Include="Hubs\Pipeline\IHubIncomingInvokerContext.cs" />
<Compile Include="Hubs\Pipeline\IHubPipeline.cs" />
@@ -160,9 +161,9 @@
<Compile Include="MessageBus\Topic.cs" />
<Compile Include="MessageBus\TopicState.cs" />
<Compile Include="MessageBus\Volatile.cs" />
- <Compile Include="PersistentConnectionContext.cs" />
- <Compile Include="PersistentConnectionFactory.cs" />
- <Compile Include="EmptyConnectionIdPrefixGenerator.cs" />
+ <Compile Include="Infrastructure\PersistentConnectionContext.cs" />
+ <Compile Include="Infrastructure\PersistentConnectionFactory.cs" />
+ <Compile Include="Infrastructure\EmptyConnectionIdPrefixGenerator.cs" />
<Compile Include="Hubs\Lookup\Descriptors\MethodDescriptor.cs" />
<Compile Include="Hubs\HubMethodNameAttribute.cs" />
<Compile Include="Hubs\DefaultHubActivator.cs" />
@@ -171,32 +172,33 @@
<Compile Include="IConnectionIdPrefixGenerator.cs" />
<Compile Include="Json\IJsonSerializer.cs" />
<Compile Include="Infrastructure\ITraceManager.cs" />
- <Compile Include="Infrastructure\DependencyResolverExtensions.cs" />
+ <Compile Include="DependencyResolverExtensions.cs" />
<Compile Include="Hubs\ReflectionHelper.cs" />
<Compile Include="Hosting\RequestExtensions.cs" />
<Compile Include="Infrastructure\TraceManager.cs" />
<Compile Include="IGroupManager.cs" />
<Compile Include="Hubs\IHubActivator.cs" />
<Compile Include="Hubs\DefaultJavaScriptProxyGenerator.cs" />
<Compile Include="Hubs\Lookup\ReflectedHubDescriptorProvider.cs" />
- <Compile Include="Hubs\Hub.cs" />
+ <Compile Include="Hub.cs" />
<Compile Include="Hubs\ClientProxy.cs" />
<Compile Include="Hubs\HubCallerContext.cs" />
<Compile Include="Hubs\HubDispatcher.cs" />
<Compile Include="Hubs\Lookup\IHubDescriptorProvider.cs" />
<Compile Include="Hubs\SignalProxy.cs" />
<Compile Include="Hubs\NullJavaScriptMinifier.cs" />
- <Compile Include="Infrastructure\IDependencyResolver.cs" />
+ <Compile Include="IDependencyResolver.cs" />
<Compile Include="Hubs\IJavaScriptMinifier.cs" />
<Compile Include="Infrastructure\SafeSet.cs" />
- <Compile Include="ITransportConnection.cs" />
+ <Compile Include="Transports\TransportConnectionExtensions.cs" />
+ <Compile Include="Transports\ITransportConnection.cs" />
<Compile Include="Json\JsonNetSerializer.cs" />
<Compile Include="Json\JsonUtility.cs" />
<Compile Include="GroupManager.cs" />
<Compile Include="Infrastructure\ServerCommand.cs" />
<Compile Include="Infrastructure\ServerCommandType.cs" />
<Compile Include="Infrastructure\ServerCommandHandler.cs" />
- <Compile Include="Command.cs" />
+ <Compile Include="MessageBus\Command.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
View
1 src/Microsoft.AspNet.SignalR.Core/Transports/ITransport.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Infrastructure;
namespace Microsoft.AspNet.SignalR.Transports
{
View
2 ...pNet.SignalR.Core/ITransportConnection.cs → ...R.Core/Transports/ITransportConnection.cs
@@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNet.SignalR
+namespace Microsoft.AspNet.SignalR.Transports
{
public interface ITransportConnection
{
View
1 src/Microsoft.AspNet.SignalR.Core/Transports/LongPollingTransport.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.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Infrastructure;
View
27 src/Microsoft.AspNet.SignalR.Core/Transports/TransportConnectionExtensions.cs
@@ -0,0 +1,27 @@
+using System.Threading.Tasks;
+
+namespace Microsoft.AspNet.SignalR.Transports
+{
+ internal static class TransportConnectionExtensions
+ {
+ internal static Task Close(this ITransportConnection connection, string connectionId)
+ {
+ var command = new Command
+ {
+ CommandType = CommandType.Disconnect
+ };
+
+ return connection.Send(new ConnectionMessage(connectionId, command));
+ }
+
+ internal static Task Abort(this ITransportConnection connection, string connectionId)
+ {
+ var command = new Command
+ {
+ CommandType = CommandType.Abort
+ };
+
+ return connection.Send(new ConnectionMessage(connectionId, command));
+ }
+ }
+}
View
1 src/Microsoft.AspNet.SignalR.Hosting.Memory/Routing/RouteManager.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNet.SignalR.Hubs;
+using Microsoft.AspNet.SignalR.Infrastructure;
namespace Microsoft.AspNet.SignalR.Hosting.Common.Routing
{
View
1 src/Microsoft.AspNet.SignalR.Owin/Handlers/PersistentConnectionHandler.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Infrastructure;
namespace Microsoft.AspNet.SignalR.Owin.Handlers
{
View
1 src/Microsoft.AspNet.SignalR.Owin/OwinExtensions.cs
@@ -4,6 +4,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using Microsoft.AspNet.SignalR;
+using Microsoft.AspNet.SignalR.Infrastructure;
using Microsoft.AspNet.SignalR.Owin;
using Microsoft.AspNet.SignalR.Owin.Handlers;
View
1 src/Microsoft.AspNet.SignalR.Stress/ConnectionRun.cs
@@ -6,6 +6,7 @@
using System.Threading;
using Microsoft.AspNet.SignalR.Stress.Connections;
using Microsoft.AspNet.SignalR.Stress.Infrastructure;
+using Microsoft.AspNet.SignalR.Transports;
namespace Microsoft.AspNet.SignalR.Stress
{
View
3 src/Microsoft.AspNet.SignalR.SystemWeb/RouteExtensions.cs
@@ -3,12 +3,13 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Web.Routing;
+using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using Microsoft.AspNet.SignalR.SystemWeb.Infrastructure;
using Microsoft.Owin.Host.SystemWeb;
using Owin;
-namespace Microsoft.AspNet.SignalR
+namespace System.Web.Routing
{
public static class RouteExtensions
{
View
1 tests/Microsoft.AspNet.SignalR.Tests/PersistentConnectionFactoryFacts.cs
@@ -1,4 +1,5 @@
using System;
+using Microsoft.AspNet.SignalR.Infrastructure;
using Moq;
using Xunit;
View
1 tests/Microsoft.AspNet.SignalR.Tests/Server/AckHandlerFacts.cs
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Infrastructure;
using Xunit;
namespace Microsoft.AspNet.SignalR.Tests.Server
View
1 tests/Microsoft.AspNet.SignalR.Tests/Server/DiffSetFacts.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Microsoft.AspNet.SignalR.Infrastructure;
using Xunit;
namespace Microsoft.AspNet.SignalR.Tests.Server

0 comments on commit 524e606

Please sign in to comment.
Something went wrong with that request. Please try again.