开发者

Use WCF to let two application to communicate?

First, let's say I don't want to use duplex channel and this is not a Client to Server senerio. I should called... Client to Client?

I have two Form Application: App1 on my computer and App2 on another computer Each of them should be hosting a WCF Service, App1 has App2's WCF Reference and App2 has App1's WCF Reference.

I wonder if I can do like that above, so I can have senerio:

  1. In App1, click button open connection to App2's WCF, send message to App2
  2. App2's WCF recevie message, display on the form.
  3. App1 close connection. (App1 application is not closed)
  4. App2, click button open connection to App1's WCF, send message to App1
  5. App1's WCF recevie message, display on the form.
  6. App2 close connection. (App2 application is not closed)

So in above senerio, you can see both application is running, they can freely to establish their own connection to another application's WCF.

I wonder if that's even possible? Because I am thinkin开发者_StackOverflow中文版g when I establish a connection to WCF, it should create a new process on the established WCF side.

And is it even possible to have a FormApplication running like that to use WCF receving message?


This scenario is possible - though there could be some "quirks":

  • Administrator rights could be needed to host a WCF service
  • What happens if one of the apps is not started (you need to implement proper handling of such situation)
  • IF the computers are not in the same LAN it could be impossible to connect without opening the firewall/port forwarding

You don't provide enough information to suggest alternatives...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜