|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Xml.Linq;
using System.ServiceModel;
using wcfDuplex.Model;
namespace wcfDuplex.Classes
{
public static class TrainServiceRunner
{
private static object myLock = new object();
private static List<IDuplexServiceClient> clients = new List<IDuplexServiceClient>();
// public static List<Author> DelayedTrains = new List<Author>();
static TrainServiceRunner(){ }
public static void watcher_Changed(List<Author> DelayedTrains)
{
try
{
//loop through connected clients
lock (myLock)
{
foreach (var client in clients)
{
client.SendTrainDelay(DelayedTrains);
}
}
}
catch (Exception)
{
//
}
}
public static void Register(IDuplexServiceClient client)
{
lock (myLock)
{
clients.Add(client);
}
}
public static void Dispose()
{
// watcher = null;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.