public WCFService(ChannelFactory <T> factory, CreateServiceImplementor <T> createServiceImplementor = null) { this.factory = factory; this.createServiceImplementor = createServiceImplementor; channels = new List <DataBase <T> >(); factory.Endpoint.Behaviors.Add(new AutoPoolBehavior <T>(this)); closeTimer = new Timer(Close, null, 0, 5000); }
public DataBase(T service, int threadId, CreateServiceImplementor <T> createServiceImplementor) { this.channel = (IClientChannel)service; if (createServiceImplementor != null) { this.service = (T)createServiceImplementor(service); } else { this.service = service; } this.threadId = threadId; Used = true; }