public static void Main(string[] args) { using (var client = new EventSourceClient("http://localhost:8080/v1/testapp/testchannel")) { client.Event += (sender, e) => Console.WriteLine("Event: " + e.Data); client.Start(); Console.ReadLine(); } }
private EventSourceClient CreateClient(Uri uri, Action <dynamic> callback) { var client = new EventSourceClient(uri); client.Event += (sender, e) => { Debug.WriteLine("[SignalhubSubscriber] Event Received"); callback(e.Data); }; client.Heartbeat += (sender, e) => { LastHeartbeatReceived = DateTime.Now; Debug.WriteLine("[SignalhubSubscriber] Heartbeat"); }; client.Start(); return(client); }