public ConnectionProxy(string serviceName, IAsyncDvcChannel connection)
 {
     this.ServiceName   = serviceName;
     this.Connection    = connection;
     this.CallbackProxy = new ClientCallbackProxy(this);
     this.ReadThread    = RunReadThread();
 }
 // Called by COM
 public IBrokeredDvcChannelServiceInstance AcceptConnection(IBrokeredDvcChannelConnection client)
 {
     try
     {
         var thunk = new ChannelThunk(client);
         Parent.AcceptConnectionInternal(thunk);
         return(thunk);
     }
     catch (Exception ex)
     {
         PluginApplication.Log($"Exception accepting connection: {ex}");
         return(null);
     }
 }
 public ChannelThunk(IBrokeredDvcChannelConnection client)
 {
     this.Client    = client ?? throw new ArgumentNullException(nameof(client));
     this.ReadQueue = new MessageQueue();
 }