WCF,客户端必须先调用服务器吗? [英] WCF, does the Client have to call the Server first?

查看:124
本文介绍了WCF,客户端必须先调用服务器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

客户端是否总是必须联系服务1?是否可以在服务类中的客户端上指定一个特定的EndPoint地址,这样当服务的每个实例都被实例化时,它每当X秒空闲时就开始调用该地址,以便让客户知道有多少服务器可用。

Does the Client always have to contact the Service 1st? Would it be possible to specify a specific EndPoint address on the Client, in the Service class, so that when each instance of the Service is instantiated, it begins calling that address every X seconds whenever it is free, in order to let the Client know how many Servers are available.

也许我缺少一些东西,但似乎当我创建一个代理,我需要知道服务器在那里。当处理大量的服务器,im假设上述将是相当方便?

Maybe im missing something but it seems as though when i create a proxy, i need to know that the server is there. When dealing with alot of servers, im assuming the above would be pretty handy? or is it usual to hard code in a list into the client of all the servers you have access to?

推荐答案

典型的方法是在你的所有服务器的客户端这个问题是将您的服务器隐藏在虚拟IP /负载均衡器之后,这将根据您的业务需求在他们之间分配请求。客户端向服务器组请求,通过单个端点可寻址,负载均衡器确定哪个服务器实例将实际处理请求。

The typical approach to this problem is to hide your servers behind a virtual IP/load balancer, which will distribute requests across them according to your business needs. The client makes a request to the bank of servers, addressable through a single endpoint, and the load balancer determines which server instance will actually handle the request.

这篇关于WCF,客户端必须先调用服务器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆