Remote Objects

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

    Remote Objects

    Could someone help with trying to help me understand this code. I am
    trying to add remote control functionality to an existing application.
    I am new to c#.

    This starts the server bit of the remote object. However, it creates
    'channel', registers it, but then, 'channel' doesn't get a mention
    after that. How is 'channel' being used? Can someone explain what
    'channel' is? Is it a pipe of sorts? Maybe a listening connection? A
    port, listening for connections?

    In the code below, Port is an intereger defined and set somewhere
    else.

    The code does work. I'm just under what it's doing.


    TcpServerChanne l channel = new TcpServerChanne l(Port);
    ChannelServices .RegisterChanne l(channel, false);

    RemotingConfigu ration.Register WellKnownServic eType(
    typeof(RCC.Cont rollerManifest) ,
    "PCS",
    WellKnownObject Mode.SingleCall );

  • Alberto Poblacion

    #2
    Re: Remote Objects

    "Cralis" <admin@myschool mates.comwrote in message
    news:1183965871 .678959.51240@n 2g2000hse.googl egroups.com...
    Could someone help with trying to help me understand this code. I am
    trying to add remote control functionality to an existing application.
    I am new to c#.
    >
    This starts the server bit of the remote object. However, it creates
    'channel', registers it, but then, 'channel' doesn't get a mention
    after that. How is 'channel' being used? Can someone explain what
    'channel' is? Is it a pipe of sorts? Maybe a listening connection? A
    port, listening for connections?
    >
    In the code below, Port is an intereger defined and set somewhere
    else.
    >
    The code does work. I'm just under what it's doing.
    >
    >
    TcpServerChanne l channel = new TcpServerChanne l(Port);
    ChannelServices .RegisterChanne l(channel, false);
    >
    RemotingConfigu ration.Register WellKnownServic eType(
    typeof(RCC.Cont rollerManifest) ,
    "PCS",
    WellKnownObject Mode.SingleCall );
    The code is using Microsoft .Net Remoting. The channel is, like you
    guessed, a pipe of sorts: it connects your server code to the client code
    (which you did not show but it needs to register a similar channel except
    that it doesn't specify the port).
    When the channel is registered, your program opens the specified TCP
    port and starts listening for requests. Whenever a request comes from your
    Remoting client, the request specifies the kind of object that is required
    (out of those that you registered with your RegisterXXXServ iceType
    instructions), the server creates such an object, and the client is able to
    call its methods across the channel.


    Comment

    Working...