Created
August 14, 2018 06:05
-
-
Save ericbrunner/b7286420f7443d5719bd18e6efd538b2 to your computer and use it in GitHub Desktop.
RoltruckCommHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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