Skip to content

Commit

Permalink
Merge pull request #56 from pusher-community/feature/dotNetStandardSu…
Browse files Browse the repository at this point in the history
…pport

Feature/dot net standard support
  • Loading branch information
kn100 authored Jun 18, 2019
2 parents 2dfd3e5 + aa75ace commit 2f1029e
Show file tree
Hide file tree
Showing 31 changed files with 223 additions and 903 deletions.
56 changes: 1 addition & 55 deletions AuthHost/AuthHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AuthHost</RootNamespace>
<AssemblyName>AuthHost</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
Expand Down Expand Up @@ -39,85 +39,31 @@
<ItemGroup>
<Reference Include="Nancy, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.1.4.4\lib\net40\Nancy.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy.Hosting.Self, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.Hosting.Self.1.4.1\lib\net40\Nancy.Hosting.Self.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PusherServer, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PusherServer.4.1.0\lib\net45\PusherServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SuperSocket.ClientEngine, Version=0.10.0.0, Culture=neutral, PublicKeyToken=ee9af13f57f00acc, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.ClientEngine.Core.0.10.0\lib\net45\SuperSocket.ClientEngine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Collections.Specialized, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Configuration.ConfigurationManager.4.4.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Security, Version=4.0.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Security.4.3.2\lib\net46\System.Net.Security.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net462\System.Runtime.InteropServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WebSocket4Net, Version=0.15.2.11, Culture=neutral, PublicKeyToken=eb4e154b696bf72a, processorArchitecture=MSIL">
<HintPath>..\packages\WebSocket4Net.0.15.2\lib\net45\WebSocket4Net.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
38 changes: 14 additions & 24 deletions AuthHost/packages.config
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net462" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net462" />
<package id="Nancy" version="1.4.4" targetFramework="net462" />
<package id="Nancy.Hosting.Self" version="1.4.1" targetFramework="net462" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net462" />
<package id="PusherServer" version="4.1.0" targetFramework="net462" />
<package id="SuperSocket.ClientEngine.Core" version="0.10.0" targetFramework="net462" />
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net462" />
<package id="System.Configuration.ConfigurationManager" version="4.4.1" targetFramework="net462" />
<package id="System.Linq" version="4.3.0" targetFramework="net462" />
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net462" />
<package id="System.Net.Security" version="4.3.2" targetFramework="net462" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net462" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net462" />
<package id="System.Threading" version="4.3.0" targetFramework="net462" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net462" />
<package id="WebSocket4Net" version="0.15.2" targetFramework="net462" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Nancy" version="1.4.4" targetFramework="net45" />
<package id="Nancy.Hosting.Self" version="1.4.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="PusherServer" version="4.1.0" targetFramework="net45" />
<package id="SuperSocket.ClientEngine.Core" version="0.10.0" targetFramework="net45" />
<package id="System.Linq" version="4.3.0" targetFramework="net45" />
<package id="System.Runtime" version="4.3.0" targetFramework="net45" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net45" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net45" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net45" />
<package id="System.Threading" version="4.3.0" targetFramework="net45" />
<package id="WebSocket4Net" version="0.15.2" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions ExampleApplication/ExampleApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExampleApplication</RootNamespace>
<AssemblyName>ExampleApplication</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
Expand Down Expand Up @@ -131,7 +131,7 @@
<Name>PusherClient.Tests.Utilities</Name>
</ProjectReference>
<ProjectReference Include="..\PusherClient\PusherClient.csproj">
<Project>{9E30E755-C00E-4BF7-B56B-8F2D836FBA60}</Project>
<Project>{a325bb9f-6476-4422-aef4-c22fa53890dd}</Project>
<Name>PusherClient</Name>
</ProjectReference>
</ItemGroup>
Expand Down
15 changes: 9 additions & 6 deletions ExampleApplication/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using PusherClient;

Expand All @@ -19,7 +20,8 @@ static void Main(string[] args)
Console.WriteLine("What is your name?");
_name = Console.ReadLine();

InitPusher();
var connectResult = Task.Run(() => InitPusher());
Task.WaitAll(connectResult);

// Read input in loop
string line;
Expand All @@ -36,7 +38,8 @@ static void Main(string[] args)
_chatChannel.Trigger("client-my-event", new {message = line, name = _name});
} while (line != null);

_pusher.Disconnect();
var disconnectResult = Task.Run(() => _pusher.DisconnectAsync());
Task.WaitAll(disconnectResult);
}

static void ListMembers()
Expand All @@ -52,7 +55,7 @@ static void ListMembers()
}

// Pusher Initiation / Connection
private static void InitPusher()
private static async Task InitPusher()
{
_pusher = new Pusher(Config.AppKey, new PusherOptions
{
Expand All @@ -62,7 +65,7 @@ private static void InitPusher()
_pusher.Error += _pusher_Error;

// Setup private channel
_chatChannel = _pusher.Subscribe("private-channel");
_chatChannel = _pusher.SubscribeAsync("private-channel").Result;
_chatChannel.Subscribed += ChatChannel_Subscribed;

// Inline binding!
Expand All @@ -72,12 +75,12 @@ private static void InitPusher()
});

// Setup presence channel
_presenceChannel = (PresenceChannel)_pusher.Subscribe("presence-channel");
_presenceChannel = (PresenceChannel)_pusher.SubscribeAsync("presence-channel").Result;
_presenceChannel.Subscribed += PresenceChannel_Subscribed;
_presenceChannel.MemberAdded += PresenceChannel_MemberAdded;
_presenceChannel.MemberRemoved += PresenceChannel_MemberRemoved;

_pusher.Connect();
await _pusher.ConnectAsync();
}

static void _pusher_Error(object sender, PusherException error)
Expand Down
26 changes: 13 additions & 13 deletions ExampleApplication/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net462" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net462" />
<package id="SuperSocket.ClientEngine.Core" version="0.10.0" targetFramework="net462" />
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net462" />
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Linq" version="4.3.0" targetFramework="net462" />
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net462" />
<package id="System.Net.Security" version="4.3.2" targetFramework="net462" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net462" />
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Net.Security" version="4.3.2" targetFramework="net462" requireReinstallation="true" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Runtime" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" requireReinstallation="true" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net462" requireReinstallation="true" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net462" />
<package id="System.Threading" version="4.3.0" targetFramework="net462" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net462" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net462" requireReinstallation="true" />
<package id="WebSocket4Net" version="0.15.2" targetFramework="net462" />
</packages>
</packages>
Binary file removed PusherClient.0.5.1.nupkg
Binary file not shown.
Loading

0 comments on commit 2f1029e

Please sign in to comment.