Roy James Schumacher
Roy James Schumacher

Reputation: 646

Two-Way Communication between Winforms Client and Remote XCF Service

I have a WCF service that will be hosted on a server and a WinForms desktop application. I would like to implement two-way communication between them and was just after some advice on which is the best way to go about this?

I've done some looking about and the two methods I'm seeing mentioned a lot are either implementing a callback contractor using web sockets.

I'm just after some advice and guidance on which of these methods to take or if there is a better method.

Upvotes: 0

Views: 1096

Answers (2)

DetectiveShmee
DetectiveShmee

Reputation: 225

I've used Callback Contract for school project and it served it's purpose nicely. If implemented well, it transfers any kind of data between the server and client. Callback is defined the same way as Contract. It's pretty simple and I advise you to look for some examples on Code Project , like this one Callback example , it's explained with minimum code. Also, in most books, Callback is used as an example for response from server. :)

Upvotes: 2

evgenyl
evgenyl

Reputation: 8117

You tag this question as winforms, so, probably, web sockets less relevant for it.

You can use callbacks (look for Duplex for mode details).

But if you have complex functionality on both sides, and firewalls on clients are not the issue - you can create 2 wcf "services" - one will run on client machine, another one - on server. This will allow you to be even more flexible (for issue like server restarted, client restarted, ...)

Upvotes: 0

Related Questions