public void Start(int port, GcmNotificationReceivedDelegate notificationReceived) { this.notificationReceived = notificationReceived; listener = new HttpListener(); listener.Prefixes.Add("http://localhost:" + port + "/"); Task.Factory.StartNew(ListenerWorker).ContinueWith(t => { var ex = t.Exception; Console.WriteLine("GcmTestServer Failed: " + ex); }, TaskContinuationOptions.OnlyOnFaulted); }
public void Start(int port, GcmNotificationReceivedDelegate notificationReceived) { this.notificationReceived = notificationReceived; listener = new HttpListener(); listener.Prefixes.Add("http://localhost:" + port + "/"); Task.Factory.StartNew(ListenerWorker).ContinueWith(t => { var ex = t.Exception; Console.WriteLine("GcmTestServer Failed: " + ex); }, TaskContinuationOptions.OnlyOnFaulted); }