76mel
76mel

Reputation: 4043

WCF Self hosting on the client? Good or Bad

Am wondering if anybody has tried this a technique to get events to the client from the server side. I have an environment that uses Unix based servers and so can't use WCF duplex / callbacks etc.

The idea being that my clients are windows boxes running a thick .net app would spin up a WCF self host and register their self host URL on the server for that session. They would have a very simple contract and the server would when it has an update call out the client server telling it that an Update is waiting on the server for it and the client would then get it etc.

I still trying to get my head round WCF so not sure if this is a good way to go, are there any security implications I should worry about ? are there ways to get the Duplex calls to work across platform.

I have done something similar before using sockets or maybe a cross platform message queue would be a better way to go on this anyhow.

Thanks

76mel

Upvotes: 5

Views: 1398

Answers (3)

Jonathan van de Veen
Jonathan van de Veen

Reputation: 1026

Another way of getting similar results could be to have the client poll. This does depend strongly on what requirements are there. If you need a near real time update, this obviously doesn't work as you would have to have way to many polls to do this, but if it's ok to take a minute or more to get updates to the client, polling might just be the answer.

Upvotes: 1

dthrasher
dthrasher

Reputation: 41812

We use self-hosted WCF for a similar scenario. We also wanted to avoid making our client application dependent on IIS, to prevent both licensing and deployment hassles.

It works fairly well for us, though WCF might be overkill for what you need. Since you're using HTTP, you could create a simple web service built directly on Http.sys.

Upvotes: 1

Tad Donaghe
Tad Donaghe

Reputation: 6588

At the very least, that sounds like it ought to work, though I'd guess you could host in IIS as well since the *nix servers could then just make a web call, right? I'm not sure what self-hosting would gain you, though it should work fine, but might be a bit more of a pain in the neck to configure, etc.

Please update here whenever you've made a decision because it sounds like an interesting challenge and some of us would like to see how you make out.

Upvotes: 1

Related Questions