c# - Fire events to client using WCF -


i know there tutorials out there regarding wcf callbacks , events, i'm having trouble getting them work, or they're complex. i'm real beginner, love hear if knows of solid beginner tutorials aimed i'm trying figure out @ moment. please forgive me if use wrong terminology (and please correct me), said i'm beginner.

the problem:

enter image description here

it might more complicated is. i'm trying accomplish is:

  1. a host local memory (lets array of 5 integers) , running wcf service. listen queries client , fire update (events?) client when 1 of these integers changed (from external source, such user input via command prompt , set()).
  2. a client can make direct queries return 1 of these 5 integers or subscribe particular index of host array.

what can do:

i can set connection, service limited standalone functions. client can make "queries", limited remote function calling (such "add", parameters passed function , processing done internally).

what i'm trying figure out:

  1. how can access variables held in host memory service contract functions? example, how can call method client getint() return stored in application memory on host?
  2. how can push "message" client host? example, in host, call tellclient(int x), call function on client side? possible without running service on both sides?

tldr:

host : service <-> client. there way push data (simply int) client without client calling functions (no polling or queries)? there way have wcf service access variables stored in instance of host application without using static members? can accomplished in simple way?

thanks , time, know wrote book. if knows of nice tutorials, please point me them. but please - don't point me add(int x, int y) example client calls add on host , returns result - i've done few times on , it's not helping me grasp real functionality of wcf. i'm not trying accomplish serious @ point, i'm trying keep simple can learn wcf can do, , i'm not finding documentation helpful. again everybody.

generally wcf used in request reply way, clients make requests; , server replies. want achieve "push , pull" service; or in microsoft terms duplex service.

in duplex services clients connect service , service registers them internal list. , whenever event(or else) arises, sends message registered clients. key terminology wcf in context of question "duplex services"(you may google find many results). may refer following tutorials;msdn or codeproject

for second part of question, answer yes. not simple. need write "wcf behaviors", instance iinstanceprovider may you. requests, may create service instance yourself, desired parameters injected service instance. referring following may help: stackoverflow or msdn.

the question bit broad not 100% sure whether direct answer. @ least using keywords provided may find right direction.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -