I have a problem with my Remote Events. This is my situation:
I have a server application (windows service) that 'hosts' a remote object.
I have 1 or more client applications that are 'using' the remote object.
When the server fires an event the clients are recieving the event.
But here I have a problem. The event handler at the client is just showing a
messagebox. If there are more than 1 clientapplication then the messagebox
is shown one by one. First on clientapp1 (when you click OK) then on
clientapp2, ...
I want to show the messagebox at the same time on all the clientapps.
How can I do that ? Can someone explain me how this works ?
(you can find the code on :
http://www.codeproject.com/useritems/Remoting_Events.asp)
Thx in advance !
Gene
The remote event handlers are being called serially. The way to fix this would be
1) - call each handler yourself by doing something like
CAOEventHandler_String_delegate seh = null;
foreach (Delegate seh_delegate in CAOEvent_String.GetInvocationList())
{
try
{
seh = (CAOEventHandler_String_delegate)seh_delegate;
seh(event_string);
}
catch (Exception ex)
{
// Removing event handler because of error
CAOEvent_String -= seh;
}
}
AND
2) - changing the call I have above to seh to an async remoting call.
or the other #2
2) - make the code on the client side immediately change threads to do the actual work and that would let the server code
continue.
(this is NOT the better choice)
>I have a problem with my Remote Events. This is my situation:
>
[quoted text clipped - 16 lines]
>
>Gene
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com