简体   繁体   中英

C# WCF return request to self hosting server

I am running WCF self hosting server. Connection is coming fine and I can process them. But now for long connections we decided to break a connection, process request and send results back to self hosting server on client side.

How do I know which client should I send a request back? DO I need remember every client address? How do I know their address, should they provide back address as input parameter? Or maybe there are much easier, correct and elegant way to solve this common issue?

Thanks!

As f0x already said, you could use callback contracts.

A link to give you a quick start:

WCF Essentials - What You Need To Know About One-Way Calls, Callbacks, And Events

Stackoverflow is bugging me:

"Oops! Your answer couldn't be submitted because: We're sorry, but as a spam prevention mechanism, new users can only post a maximum of two hyperlinks. Earn more than 10 reputation to post more hyperlinks."

So, checkout this link http://pastebin.com/4U953w3f for more resources.

Advanced Stuff and things you should worry about:

  • Detecting Client disconnection
  • Reestablish Connection Management
  • Concurrency Mode and Instancing (Threading..) / Synchronization Contexts

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