Discussion:
Wired problem with remoting and events
(too old to reply)
Lukas Thanei
2008-07-08 06:58:26 UTC
Permalink
Hi everyone,

I've got a problem with remoting in connection with events. Im using
Remotingservices.Marshal() and Activator.GetObject in connection with a
tcp channel.

Server:
RemotingServices.Marshal(remoteobject, "remoteobject")

Client:
remoteobject = Activator.GetObject(GetType(RemoteType), uri)

So far everything works well, the remote object is available, I can call
remote methods and get exceptions and events as expected.

Now, when a client calls a method A, which raises an event (which itself
has so be sent back to the clients), the server program gets stuck on
the last line of that method A (End Function). There is no exception thrown.

I figured out that I can avoid that problem just by caching all events
till the remote call has been completed and raise them afterwards. This
is not really the solution I want to have, because method calls can take
some seconds and event should be delivered in time. Any suggestions on
how to fix this issue?

Thanks!
Jeff Winn
2008-07-09 23:03:53 UTC
Permalink
I hope I'm understanding your problem correctly. Events are synchronous, if
you don't want the server to wait for the event to finish you might consider
using a delegate (that isn't an event) and invoking it asynchronously. Or
get the invocation list from the event and call them asynchronously
manually.

How you'd do this in VB is outside of the scope of my abilities as I
primarily use C#.
Post by Lukas Thanei
Hi everyone,
I've got a problem with remoting in connection with events. Im using
Remotingservices.Marshal() and Activator.GetObject in connection with a
tcp channel.
RemotingServices.Marshal(remoteobject, "remoteobject")
remoteobject = Activator.GetObject(GetType(RemoteType), uri)
So far everything works well, the remote object is available, I can call
remote methods and get exceptions and events as expected.
Now, when a client calls a method A, which raises an event (which itself
has so be sent back to the clients), the server program gets stuck on the
last line of that method A (End Function). There is no exception thrown.
I figured out that I can avoid that problem just by caching all events
till the remote call has been completed and raise them afterwards. This is
not really the solution I want to have, because method calls can take some
seconds and event should be delivered in time. Any suggestions on how to
fix this issue?
Thanks!
Loading...