Skip to content

Instantly share code, notes, and snippets.

@tebeco
Last active May 15, 2019 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tebeco/40ca29b078f3863ea45cc01ddf4fc7ef to your computer and use it in GitHub Desktop.
Save tebeco/40ca29b078f3863ea45cc01ddf4fc7ef to your computer and use it in GitHub Desktop.
coincoin
using Microsoft.AspNetCore.SignalR.Client;
using System;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
public static async Task Main()
{
Console.ReadLine();
var hubConnection = new HubConnectionBuilder()
.WithUrl("https://dropme.azurewebsites.net/myHub")
.Build();
hubConnection.On<string,string,string>("ReceiveMessage", (a, b, c) =>
{
Console.WriteLine($"a : '{a}'");
Console.WriteLine($"b : '{b}'");
Console.WriteLine($"c : '{c}'");
});
try
{
await hubConnection.StartAsync();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.1.0" />
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment