Downcasting on the receiving end of TSocket

Dear ROOTers,
one generel question. Suppose that I have a class hierarchy Base, Derived, Derived. If on the receiving end of a TSocket I do
Base* ptr=(Base*)msg.ReadObjectAny(Base::Class())
is it safe to downcast any time afterwards to Derived or is it necessary to retrieve the exact type of the object immediately? Thanks,
filimon

[quote]one generel question. Suppose that I have a class hierarchy Base, Derived, Derived. If on the receiving end of a TSocket I do
Base* ptr=(Base*)msg.ReadObjectAny(Base::Class()) [/quote]This is the correct code.

It is safe as long as you use dynamic_cast for the casting (It may (or may not) be safe to use a C-style cast depending on your class hierachy).

Cheers,
Philippe