Skip to content

Instantly share code, notes, and snippets.

@ericbrunner
Created August 14, 2018 06:05
Show Gist options
  • Save ericbrunner/b7286420f7443d5719bd18e6efd538b2 to your computer and use it in GitHub Desktop.
Save ericbrunner/b7286420f7443d5719bd18e6efd538b2 to your computer and use it in GitHub Desktop.
RoltruckCommHub
using Microsoft.AspNetCore.SignalR;
namespace TruckerWebApp.RestApi.Hub
{
public class RoltruckCommHub : Microsoft.AspNetCore.SignalR.Hub
{
public void BroadcastMessage(string name, string message)
{
Clients.All.SendAsync("broadcastMessage", name, message);
}
public void Echo(string name, string message)
{
Clients.Client(Context.ConnectionId).SendAsync("echo", name, message + " (echo from server)");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment