Custom ObjRef class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Osborne

    #1

    Custom ObjRef class

    Hello:

    I have a client server application that I am currently developing and have
    some issues that I feel can be best resolved using a custom ObjRef child
    class. I have created the class OK, and have overridden my
    MarshalByRefObj ect child class so that the CreateObjRef returns an instance
    of my new custom ObjRef derivative.

    I can see the server create my ObjRef class and I can also see my ObjRef
    class being serialized by the server, but It appears that my ObjRef class is
    never deserialize by the client. Does anybody else have experience with
    custom ObjRef classes and if so, is there something that I need to be doing
    to get my MarshalByRefObj ects to be marshaled using my ObjRef class?

    Thank you for your help

    Matt Osborne


  • Lostinet[MS DOTNET MVP]

    #2
    Re: Custom ObjRef class

    HI,
    When your MBRO marshal to client site,the CreateObjRef would never be
    called at client site because the real MBRO is at server site.

    When the client get the info of the MBRO of server,dotnet will
    deserialize it to the normal ObjRef class. And then, dotnet will create a
    RealProxy and use RemotingService .Unmarshal to combine the ObjRef and
    RealProxy into TransparentProx y.

    What you get the object at the client site is just the TransparentProx y.
    When you invoke methods on the TransparentProx y, the RealProxy.Priva teInvoke
    will be called, and the methodcall information will be send to the server
    and invoke the real object.

    The child class of ObjRef is not important. you should set the
    ObjRef.ChannelI nfo/EnvoyInfo/TypeInfo as your custom info class. these infos
    would be serialize at server and deserialize at client, these would be more
    helpful.

    --


    Thanks.

    Lostinet (MS .NET MVP)
    lostinetweb@hot mail.com
    ---------------------------
    Need MessageBox,Comb oBox,DatePicker ,PasswordBox,Tr eeView,ASP.Net RPC ?

    ---------------------------
    Get ContextBoundMod el For AOP.NET!

    ---------------------------

    "Matt Osborne" <private@stupid Spamer.net> дÈëÏûÏ¢
    news:cz8wc.6529 5$hL5.29581@new ssvr29.news.pro digy.com...[color=blue]
    > Hello:
    >
    > I have a client server application that I am currently developing and have
    > some issues that I feel can be best resolved using a custom ObjRef child
    > class. I have created the class OK, and have overridden my
    > MarshalByRefObj ect child class so that the CreateObjRef returns an[/color]
    instance[color=blue]
    > of my new custom ObjRef derivative.
    >
    > I can see the server create my ObjRef class and I can also see my ObjRef
    > class being serialized by the server, but It appears that my ObjRef class[/color]
    is[color=blue]
    > never deserialize by the client. Does anybody else have experience with
    > custom ObjRef classes and if so, is there something that I need to be[/color]
    doing[color=blue]
    > to get my MarshalByRefObj ects to be marshaled using my ObjRef class?
    >
    > Thank you for your help
    >
    > Matt Osborne
    >
    >[/color]


    Comment

    Working...