/// <summary> /// Create twin container factory /// </summary> /// <param name="client"></param> /// <param name="logger"></param> /// <param name="injector"></param> public TwinContainerFactory(IClientHost client, ILogger logger, IInjector injector = null) { _client = client ?? throw new ArgumentNullException(nameof(client)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _injector = injector; }
public void Start(ClientStartInfo startInfo) { if (_disposed) { throw new ObjectDisposedException(nameof(PipeRpcServer)); } if (_started) { throw new InvalidOperationException("RPC server has already been started"); } _started = true; if (startInfo != null) { _clientHost = _mode == PipeRpcServerMode.Remote ? (IClientHost) new OutOfProcessHost(startInfo) : new InProcessHost(startInfo); _clientHost.Exited += _clientHost_Exited; } if (_mode == PipeRpcServerMode.Remote) { _inStream.DisposeLocalCopyOfClientHandle(); _outStream.DisposeLocalCopyOfClientHandle(); } if (_clientHost?.HasExited == true) { throw new PipeRpcException("RPC client failed to start"); } }
public static void SetNetworkHost(IClientHost network) { NetworkHost = network; if (chatForm != null) { chatForm.SetnetworkHost(network); } }
/// <summary> /// Create twin services /// </summary> /// <param name="client"></param> /// <param name="services"></param> /// <param name="events"></param> /// <param name="logger"></param> public TwinServices(IClientHost client, IEndpointServices services, IEventEmitter events, ILogger logger) { _client = client ?? throw new ArgumentNullException(nameof(client)); _services = services ?? throw new ArgumentNullException(nameof(services)); _events = events ?? throw new ArgumentNullException(nameof(events)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public void OnPluginLoad(IClientHost server) { NetworkHost = server; TaskManagerHandler.SetNetworkHost(NetworkHost); RegistryEditorHandler.SetNetworkHost(NetworkHost); FileManagerHandler.SetNetworkHost(NetworkHost); ConsoleHandler.SetNetworkHost(NetworkHost); MiscHandler.SetClientHost(server); ClipboardHandler.SetHost(server); StartupHandler.SetHost(server); ConnectionsHandler.SetHost(server); }
private IOperation BuildClientHostOperation() { const int FIVE_SECONDS = 5000; var processId = Process.GetCurrentProcess().Id; var factory = new HostObjectFactory(); var host = new ClientHost(configuration.AppConfig.ClientAddress, factory, new ModuleLogger(logger, nameof(ClientHost)), processId, FIVE_SECONDS); var operation = new CommunicationHostOperation(host, logger); clientHost = host; clientHost.AuthenticationToken = authenticationToken; return(operation); }
public void Dispose() { if (!_disposed) { if (_writer != null) { Util.NoThrow(() => { lock (_syncRoot) { SendCommand("quit"); } }); Util.DisposeSilently(_writer); _writer = null; } if (_reader != null) { Util.DisposeSilently(_reader); _reader = null; } if (_inStream != null) { Util.NoThrow(_inStream.DisposeLocalCopyOfClientHandle); Util.DisposeSilently(_inStream); _inStream = null; } if (_outStream != null) { Util.NoThrow(_outStream.DisposeLocalCopyOfClientHandle); Util.DisposeSilently(_outStream); _outStream = null; } if (_clientHost != null) { _clientHost.Exited -= _clientHost_Exited; _clientHost.Dispose(); _clientHost = null; } _disposed = true; } }
public static void SetNetworkHost(IClientHost host) { ImgEncoder = GetEncoder(ImageFormat.Png); NetworkHost = host; }
public void SetnetworkHost(IClientHost network) { networkHost = network; }
public static void SetNetworkHost(IClientHost _connection) { NetworkHost = _connection; }
public void OnPluginLoad(IClientHost server) { RemoteChatHandler.SetNetworkHost(server); RemoteDesktopHandler.SetNetworkHost(server); }
public ClientHostDisconnectionOperation(IClientHost clientHost, ILogger logger, int timeout_ms) { this.clientHost = clientHost; this.logger = logger; this.timeout_ms = timeout_ms; }
public RemoteChatForm(IClientHost initNet) { InitializeComponent(); networkHost = initNet; }
public static void SetHost(IClientHost _host) { Host = _host; }
public void OnPluginLoad(IClientHost server) { MiscHandler.Load(); }
public static void SetNetworkHost(IClientHost host) { NetworkHost = host; }
public static void SetNetworkHost(IClientHost connection) { NetworkHost = connection; }