public IpcDevice(Func <DuplexServiceClient <TService, TCallback> > clientCreator) { Contract.Requires(clientCreator != null); _creator = clientCreator; _client = clientCreator(); _client.Open(); }
static void Main(string[] args) { var callback = new InstanceContext(new ClientCallback()); var client = new DuplexServiceClient(callback); client.Open(); client.Register(); Console.WriteLine("Press a key to exit"); Console.ReadKey(); client.Close(); }
private void Connect() { _client = _creator(); _client.Open(); }