/// <summary> /// コンストラクタ /// </summary> public EvaluationControl() { InitializeBindings(this); this.client = new EvaluationClient(); this.client.CommandReceived += client_CommandReceived; }
public OpenCdsService(String endPoint, int requestTimeout, int connectTimeout) { this.endPoint = endPoint; this.requestTimeout = requestTimeout; this.connectTimeout = connectTimeout; BasicHttpBinding binding = new BasicHttpBinding(); binding.Name = "OpenCdsService"; binding.OpenTimeout = TimeSpan.FromMilliseconds(connectTimeout); binding.ReceiveTimeout = TimeSpan.FromMilliseconds(requestTimeout); binding.MaxBufferSize = 65536; binding.MaxBufferPoolSize = 524288; binding.ReaderQuotas.MaxDepth = 32; binding.ReaderQuotas.MaxStringContentLength = 65536; binding.ReaderQuotas.MaxArrayLength = 16384; binding.ReaderQuotas.MaxBytesPerRead = 4096; binding.ReaderQuotas.MaxNameTableCharCount = 16384; EndpointAddress remoteAddress = new EndpointAddress(endPoint); service = new EvaluationClient(binding, remoteAddress); Console.WriteLine("Constructing OpenCdsService from " + endPoint); }
public List <IPEndPoint> GetActiveServices(string serviceName) { var endpoints = new List <IPEndPoint> (); var services = GetServices(serviceName, true); if (services == null || services.Count == 0) { throw new GAF.Network.SocketException("Unable to retrieve services from Service Discovery."); } foreach (var service in services) { var address = service.Service.Address; var port = service.Service.Port; if (!endpoints.Where(e => e.Address.ToString().Equals(address) && e.Port == port).Any()) { endpoints.Add(EvaluationClient.CreateEndpoint(string.Format("{0}:{1}", address, port))); } } return(endpoints); }
static async Task Main(string[] args) { using var httpClient = new HttpClient(); var ingredientClient = new EvaluationClient(httpClient); var ingredients = await ingredientClient.EvaluationGetAsync(); }