I experienced the same problem and I was unable to send event from windows service. Being run out of time I resolved it by registering event listener on a server. So that each client register its own event listener on server and unregister when terminating. Something like this:
class Server
{
private EventListener _listener;//actually I put array of listeners here
public void RegisterListener(EventListener listener)
{
_listener = listener;
}
protected void SendEvent()
{
if (_listener != null)
{
try
{
_listener.InvokeEvent();
}
catch
{
}
}
}
}
class EventListener //created on a client
{
public InvokeEvent()
{
//Invoke delegate on a client side here
}
}
|