WCF singleton service + callbacks

S

sandrofurlan

Hi there,
I've a wcf singleton service and I need to send callbacks to all
connected clients. At the status only the last connected client
receive callbacks.

This is the code:

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single, _
ConcurrencyMode:=ConcurrencyMode.Multiple)> _
Public Class CalculatorService
Implements ICalculator

Private callback As ICalculatorCallback = Nothing

public sub New()
'open my USB comm object
comm.open(myusbdevice)
'start secondary thread for receiving data from USB device
threadListener = New System.Threading.Thread(AddressOf
Listener)
threadListener.IsBackground = True
threadListener.Start()
end sub

public function Connect() as Boolean
callback = OperationContext.Current.GetCallbackChannel(Of
ICalculatorCallback)()
return true
end sub

protected sub Listener

do while threadlistener isnot nothing

......

callback.result(myparams)

.....

loop

end sub

I think i've got to store connected clients somewhere but I don't know
how.
Please help me!
thanks

end class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top