public bool Initialize() { lock (_lockObject) { if (IsAlive) { return(false); } try { var comp = NamingServiceManager.Default.GetComponent(_namingName); _portService = comp.GetPort(_portName); var prof = _portService.get_port_profile(); Key = _namingName + ":" + prof.name; IsAlive = true; return(true); } catch (Exception) { IsAlive = false; NotifyError("RTコンポーネントの接続に失敗しました。"); return(false); } } }
public JobController() { unitOfWork = new UnitOfWork(); jobService = new JobService(unitOfWork); supplierService = new SupplierService(unitOfWork); portService = new PortService(unitOfWork); countryService = new CountryService(unitOfWork); clientService = new ClientService(unitOfWork); }
public void GetRandomFreePort_NotSsl_1025To65535() { IPortService portService = new PortService(); for (int i = 0; i < 10000; ++i) { int port = portService.GetRandomFreePort(); Assert.InRange(port, 1025, 65535); } }
public void GetRandomFreePort_Ssl_44300To44399() { IPortService portService = new PortService(); for (int i = 0; i < 200; ++i) { int port = portService.GetRandomFreePort(true); Assert.InRange(port, 44300, 44399); } }
public PortServiceAdapter(PortService target) { _target = target; }
public bool Initialize() { lock (_lockObject) { if (IsAlive) return false; try { var comp = NamingServiceManager.Default.GetComponent(_namingName); _portService = comp.GetPort(_portName); var prof = _portService.get_port_profile(); Key = _namingName + ":" + prof.name; IsAlive = true; return true; } catch (Exception) { IsAlive = false; NotifyError("RTコンポーネントの接続に失敗しました。"); return false; } } }
public PortController() { unitOfWork = new UnitOfWork(); portService = new PortService(unitOfWork); countryService = new CountryService(unitOfWork); }