all groups > dotnet remoting > august 2003 >
You're in the

dotnet remoting

group:

Hooking RealProxy/Identity Creation


Hooking RealProxy/Identity Creation Tim Findlow
8/27/2003 11:41:26 AM
dotnet remoting:
G'day,

I've got a slight problem - does anyone have any
suggestions?

I have a server with a few potentially long-lived clients.
Each client maintains a large number of long-term
references to MBR objects on the server. I therefore need
to implement an ISponsor object on the server that will
keep the server object's lease current until all client
references are garbage collected.

I figure I can do this by hooking the creation of the real
proxy object and then maintaining a (client-side) lookup
table of weak references to the real proxy objects. The
list of valid references can periodically be transmitted
to the sponsor on the server.

This is essentially what the internal framework class
IdentityHolder is doing when it maintains a table of weak
references to Identity objects which references (is
referenced by) the real proxy object.

This approach has the downside of requiring me to change
all of my MBR objects to inherit from ContextBoundObject,
since ProxyAttribute can't be applied to objects derived
directly from MarshalByRefObject.

Does anybody know any way of obtaining/maintaining a list
of active proxy objects on the client-side?

Thanks

Tim

Hooking RealProxy/Identity Creation Tim Findlow
8/29/2003 6:00:50 PM
If anyone's interested - Final solution was to use
System.Runtime.Remoting.Services.TrackingServices to catch
the Unmarshal event.

Tim


[quoted text, click to view]
AddThis Social Bookmark Button