Skip to content

Commit

Permalink
Merge pull request #56 from igitur/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yallie authored Nov 14, 2024
2 parents ff402de + 34d2fc3 commit 14448f0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CoreRemoting.Tests/RpcTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions CoreRemoting/CallContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public static object GetData(string name) =>
/// <returns>Array of call context entries</returns>
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -147,13 +150,16 @@ private static IServerChannel CreateServerChannelFromConfigName(string channelTy
/// <returns>Client channel</returns>
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public int KeySize
/// <summary>
/// Gets or sets the name of the serializer which should be used by the server instance.
/// </summary>
[ConfigurationProperty("serializer", IsRequired = false, DefaultValue = "binary")]
[ConfigurationProperty("serializer", IsRequired = false, DefaultValue = "bson")]
public string Serializer
{
get => (string)base["serializer"];
Expand All @@ -61,7 +61,7 @@ public string Serializer
/// <summary>
/// Gets or sets the type of the server channel which should be used for communication.
/// </summary>
[ConfigurationProperty("channel", IsRequired = false, DefaultValue = "ws")]
[ConfigurationProperty("channel", IsRequired = false, DefaultValue = "tcp")]
public string Channel
{
get => (string)base["channel"];
Expand Down
6 changes: 3 additions & 3 deletions CoreRemoting/Serialization/CrossFrameworkSerialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,12 +45,12 @@ public static void RedirectPrivateCoreLibToMscorlib()
{
RedirectAssembly("System.Private.CoreLib", "mscorlib");
}

/// <summary>
/// Redirects assembly "mscorlib" to "System.Private.CoreLib".
/// </summary>
public static void RedirectMscorlibToPrivateCoreLib()
{
RedirectAssembly("mscorlib", "System.Private.CoreLib");
}
}
}

0 comments on commit 14448f0

Please sign in to comment.