J
JamesB
OK, after lots of faffing I have finally gotten remoting working - basically
I have a windows service (the "server") and a forms app (the "client").
The forms app can call methods in the server, and I can get events fired on
the server to be picked up and acted on in the client app, so all is well. I
can even get two client apps on different machines talking to the same
server instance and the events pop up on both.
This is all good until the "first" client app instance dies unexpectedly
(i.e. for testing, I am just killing it in task manager). The events never
reach the other instance, as the server seems to be sending out the events
synchronously to any connected clients. (I have got some code to unregister
the client/event in the form close event, so if you quit "gracefully" this
problem doesn't occur).
Is there any way of either a) removing a crashed client from the servers
internal list? (I do get an exception in the server when my event is fired,
basically saying the target machine actively refused connection - but what
to do with that info!) or b) can I send out my events from the server in
some async/simultaneous way so it doesn't matter if a client instance has
died or not.
I'd prefer option a as it seems neater, but hey-ho.
TIA
James.
I have a windows service (the "server") and a forms app (the "client").
The forms app can call methods in the server, and I can get events fired on
the server to be picked up and acted on in the client app, so all is well. I
can even get two client apps on different machines talking to the same
server instance and the events pop up on both.
This is all good until the "first" client app instance dies unexpectedly
(i.e. for testing, I am just killing it in task manager). The events never
reach the other instance, as the server seems to be sending out the events
synchronously to any connected clients. (I have got some code to unregister
the client/event in the form close event, so if you quit "gracefully" this
problem doesn't occur).
Is there any way of either a) removing a crashed client from the servers
internal list? (I do get an exception in the server when my event is fired,
basically saying the target machine actively refused connection - but what
to do with that info!) or b) can I send out my events from the server in
some async/simultaneous way so it doesn't matter if a client instance has
died or not.
I'd prefer option a as it seems neater, but hey-ho.
TIA
James.