tags:

views:

33

answers:

2

Hello =)

I have a multi-gui one-service architecture (i implement both, service and client) (using .net 3.5, c#, windows application/service).

whats the best practice to update the guis? i know duplex communication, but if the client doesn't send any requests for some time, the channel is closed! increasing the timeout is not the best solution...?!

Regards Marcus

A: 

The GUIs are sending commands to the service per TCP Duplex. Each time, one GUI is changing some things, the other guis have to be informed about the changes, happend to the service.

first solution: the guis can poll each x seconds the service to ask: are there updates?

but i don't really like this solution. each time a change happend, the service send an "gui you have to update" via callback to each gui. but mayby all the channels are not open anymore...

hope this helps to understand (sorry for my very bad english)

Marcus
A: 

If you want architecture where client registers to the service and service pushes data changes to clients immediately when changes happen than duplex binding is the solution. Otherwise don't use duplex binding.

If you don't like the idea of increasing connection timeout you can always implement your own keep alive mechanism. Client will continue sending some keep alive messages to the service in predefined interval so connection will be still opened.

Ladislav Mrnka