diff --git a/CoreRemoting.Tests/RpcTests.cs b/CoreRemoting.Tests/RpcTests.cs index 124ee9a..c5ed7a7 100644 --- a/CoreRemoting.Tests/RpcTests.cs +++ b/CoreRemoting.Tests/RpcTests.cs @@ -205,7 +205,7 @@ void ClientAction() } [Fact] - public void Events_should_work_remotly() + public void Events_should_work_remotely() { bool serviceEventCalled = false; bool customDelegateEventCalled = false; diff --git a/CoreRemoting/CallContext.cs b/CoreRemoting/CallContext.cs index 7e85b99..82f5b23 100644 --- a/CoreRemoting/CallContext.cs +++ b/CoreRemoting/CallContext.cs @@ -35,12 +35,12 @@ public static object GetData(string name) => /// Array of call context entries public static CallContextEntry[] GetSnapshot() { - var stateSnaphsot = State.ToArray(); - var result = new CallContextEntry[stateSnaphsot.Length]; + var stateSnapshot = State.ToArray(); + var result = new CallContextEntry[stateSnapshot.Length]; - for(int i = 0; i< stateSnaphsot.Length; i++) + for(int i = 0; i< stateSnapshot.Length; i++) { - var entry = stateSnaphsot[i]; + var entry = stateSnapshot[i]; result[i] = new CallContextEntry diff --git a/CoreRemoting/ClassicRemotingApi/ConfigSection/ConfigSectionExtensionMethods.cs b/CoreRemoting/ClassicRemotingApi/ConfigSection/ConfigSectionExtensionMethods.cs index 22dce28..f085aa8 100644 --- a/CoreRemoting/ClassicRemotingApi/ConfigSection/ConfigSectionExtensionMethods.cs +++ b/CoreRemoting/ClassicRemotingApi/ConfigSection/ConfigSectionExtensionMethods.cs @@ -128,13 +128,16 @@ private static IServerChannel CreateServerChannelFromConfigName(string channelTy { var websocketServerChannelShortcuts = new[] {"ws", "websocket"}; - + + var tcpServerChannelShortcuts = + new[] {"tcp"}; + if (websocketServerChannelShortcuts.Contains(channelTypeName.ToLower())) return new WebsocketServerChannel(); - if (channelTypeName == "tcp") + if (tcpServerChannelShortcuts.Contains(channelTypeName.ToLower())) return new TcpServerChannel(); - + var channelType = GetTypeFromConfigString(channelTypeName); return (IServerChannel) Activator.CreateInstance(channelType); @@ -147,13 +150,16 @@ private static IServerChannel CreateServerChannelFromConfigName(string channelTy /// Client channel private static IClientChannel CreateClientChannelFromConfigName(string channelTypeName) { - var websocketServerChannelShortcuts = + var websocketClientChannelShortcuts = new[] {"ws", "websocket"}; - if (websocketServerChannelShortcuts.Contains(channelTypeName.ToLower())) + var tcpClientChannelShortcuts = + new[] {"tcp"}; + + if (websocketClientChannelShortcuts.Contains(channelTypeName.ToLower())) return new WebsocketClientChannel(); - if (channelTypeName == "tcp") + if (tcpClientChannelShortcuts.Contains(channelTypeName.ToLower())) return new TcpClientChannel(); var channelType = GetTypeFromConfigString(channelTypeName); diff --git a/CoreRemoting/ClassicRemotingApi/ConfigSection/ServerInstanceConfigElement.cs b/CoreRemoting/ClassicRemotingApi/ConfigSection/ServerInstanceConfigElement.cs index c817ebb..100f678 100644 --- a/CoreRemoting/ClassicRemotingApi/ConfigSection/ServerInstanceConfigElement.cs +++ b/CoreRemoting/ClassicRemotingApi/ConfigSection/ServerInstanceConfigElement.cs @@ -51,7 +51,7 @@ public int KeySize /// /// Gets or sets the name of the serializer which should be used by the server instance. /// - [ConfigurationProperty("serializer", IsRequired = false, DefaultValue = "binary")] + [ConfigurationProperty("serializer", IsRequired = false, DefaultValue = "bson")] public string Serializer { get => (string)base["serializer"]; @@ -61,7 +61,7 @@ public string Serializer /// /// Gets or sets the type of the server channel which should be used for communication. /// - [ConfigurationProperty("channel", IsRequired = false, DefaultValue = "ws")] + [ConfigurationProperty("channel", IsRequired = false, DefaultValue = "tcp")] public string Channel { get => (string)base["channel"]; diff --git a/CoreRemoting/Serialization/CrossFrameworkSerialization.cs b/CoreRemoting/Serialization/CrossFrameworkSerialization.cs index 162a9e4..ba0c805 100644 --- a/CoreRemoting/Serialization/CrossFrameworkSerialization.cs +++ b/CoreRemoting/Serialization/CrossFrameworkSerialization.cs @@ -18,7 +18,7 @@ public static void RedirectAssembly(string assemblyShortName, string replacement Assembly HandleAssemblyResolve(object _, ResolveEventArgs args) { var requestedAssembly = new AssemblyName(args.Name); - + if (requestedAssembly.Name == assemblyShortName) { try @@ -45,7 +45,7 @@ public static void RedirectPrivateCoreLibToMscorlib() { RedirectAssembly("System.Private.CoreLib", "mscorlib"); } - + /// /// Redirects assembly "mscorlib" to "System.Private.CoreLib". /// @@ -53,4 +53,4 @@ public static void RedirectMscorlibToPrivateCoreLib() { RedirectAssembly("mscorlib", "System.Private.CoreLib"); } -} \ No newline at end of file +}