CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Posts
    26

    Remoting client channel

    Should each .NET Remoting client create a new channel and unregister it after use in multithreaded client system, when different threads on the client side may activate the same remoting object on the server side simultaniously? We use WellKnown SingleCall object accessible via TCP channel.

    Thank you,
    a_k_

  2. #2
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: Remoting client channel

    client??? clients aren't as important as the server objects. you should be ok without messing with the client. if you have multiple threads that may publish / revoke the server object, then yea, you need to manage that.

  3. #3
    Join Date
    Sep 2002
    Posts
    26

    Re: Remoting client channel

    Thank you very much for your reply

    Regarding the client - is it possible that response that arrives thru the same channel to several different clients at the same time going to be mixed?

    Regarding the server - the SingleCall setting insure that separate object is going to be created on server side for each client request. Does separate channel also created automatically for each client connection on the server side? or I have to manage that?
    Last edited by a_k_; April 10th, 2007 at 06:37 PM.

  4. #4
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: Remoting client channel

    channels are created independently of the objects for a reason. because .NET takes care of what uses what.

    nothing will ever get stepped on / stumbled over. remoting isn't some simple tcp connection where one object might use another objects info off the TCP stack to initialize objects randomly. each server object is created on the client side through a transparent proxy and can only be unwrapped by that proxy.

    single call objects are like disposable objects. they are used once and then destroyed on the client's end.

  5. #5
    Join Date
    Sep 2002
    Posts
    26

    Re: Remoting client channel

    Thank you for your help.
    It is SO different from the classic TCP client/server I used before...
    I'm just double-checking if it is OK to create and register just ONE channel on the client side and share it for all the concurrent client calls?
    Is the following code correct:

    if (!_RemotingClientConfigDone)
    {
    TcpChannel channel = new TcpChannel();
    ChannelServices.RegisterChannel(channel, false);
    _RemotingClientConfigDone = true;
    }
    obj = Activator.GetObject(
    remotingObjectType,
    objectUrl);

    where _RemotingClientConfigDone is defined as a static variable in the class:

    static bool _RemotingClientConfigDone = false;

    Thank you,
    a_k_

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured