internal string SendCommand(string input) { if (string.IsNullOrEmpty(input)) { ASF.ArchiLogger.LogNullError(nameof(input)); return(null); } ASF.ArchiLogger.LogGenericInfo(string.Format(Strings.WCFSendingCommand, input, URL)); if (Client == null) { Client = new Client( new NetTcpBinding { // We use SecurityMode.None for Mono compatibility // Yes, also on Windows, for Mono<->Windows communication Security = { Mode = SecurityMode.None }, SendTimeout = new TimeSpan(0, 0, Program.GlobalConfig.ConnectionTimeout) }, new EndpointAddress(URL) ); } return(Client.HandleCommand(input)); }
internal string SendCommand(string input) { if (Client == null) { Client = new Client(new BasicHttpBinding(), new EndpointAddress(URL)); } return(Client.HandleCommand(input)); }
internal string SendCommand(string input) { if (string.IsNullOrEmpty(input)) { Logging.LogNullError(nameof(input)); return(null); } if (Client == null) { Client = new Client(new BasicHttpBinding(), new EndpointAddress(URL)); } return(Client.HandleCommand(input)); }
internal string SendCommand(string input) { if (string.IsNullOrEmpty(input)) { ASF.ArchiLogger.LogNullError(nameof(input)); return(null); } ASF.ArchiLogger.LogGenericInfo("Sending command: " + input + " to WCF server on " + URL + "..."); if (Client == null) { Client = new Client(new NetTcpBinding { Security = { Mode = SecurityMode.None } }, new EndpointAddress(URL)); } return(Client.HandleCommand(input)); }
internal string SendCommand(string input) { if (string.IsNullOrEmpty(input)) { ASF.ArchiLogger.LogNullError(nameof(input)); return(null); } Binding binding = GetTargetBinding(); if (binding == null) { ASF.ArchiLogger.LogNullError(nameof(binding)); return(null); } string url = GetUrlFromBinding(binding); if (string.IsNullOrEmpty(url)) { ASF.ArchiLogger.LogNullError(nameof(url)); return(null); } ASF.ArchiLogger.LogGenericInfo(string.Format(Strings.WCFSendingCommand, input, url)); if (Client == null) { Client = new Client( binding, new EndpointAddress(url) ); } return(Client.HandleCommand(input)); }