简体   繁体   中英

WCF, does the Client have to call the Server first?

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.

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM