private void _Connect(IConnect obj) { var address = System.Net.IPAddress.Parse(this._IpAddress); var result = obj.Connect(new System.Net.IPEndPoint(address, _Port)); result.OnValue += val => { this.OnDoneEvent(val); }; }
private async Task ConnectToHub() { try { if (await _connectionInstance.Connect(_configuration.GetSection("ConnectionInfo")["PrimaryHubUri"], _currentModuleType)) { _logger.LogInformation($"Successfully connected to Primary Hub which located on: {_configuration.GetSection("ConnectionInfo")["PrimaryHubUri"]}"); //Console.WriteLine("Connected to first hub"); } else if (await _connectionInstance.Connect(_configuration.GetSection("ConnectionInfo")["SecondaryHubUri"], _currentModuleType)) { _logger.LogInformation($"Successfully connected to Secondary Hub which located on: {_configuration.GetSection("ConnectionInfo")["SecondaryHubUri"]}"); //Console.WriteLine("Connected to second hub"); } } catch (Exception e) { _logger.LogCritical("Could not connect to any hub, looking for available hubs in network"); //TODO: Make this feature } }
private static void ConnectProvider_Supply(IConnect obj) { var result = obj.Connect("127.0.0.1", 12345); result.OnValue += val => { if(val) { Console.WriteLine("連線成功"); } else { Console.WriteLine("連線失敗"); Program._Enable = false; } }; }
private void _Provider_Supply(IConnect obj) { obj.Connect(_Ip, _Port).OnValue += _Result; }
private void _Connect(IConnect obj) { var result = obj.Connect(this._IpAddress, this._Port); result.OnValue += val => { this.OnDoneEvent(val); }; }
private void _Connect(IConnect obj) { _Con = obj; _ConnectResult(_Con.Connect(_IPAddress, _Port)); }
/// <summary> /// The _ connect. /// </summary> /// <param name="obj"> /// The obj. /// </param> private void _Connect(IConnect obj) { _Provider.Supply -= _Connect; obj.Connect(_Ip, _Port).OnValue += _Result; }
public void Connect(string ip, int port) { IConnect icon = (IConnect)icom; icon.Connect(ip, port); }
private Regulus.Remote.Value <bool> _Connect(IConnect gpi, string ip, int port) { return(gpi.Connect(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ip), port))); }