Results 1 to 12 of 12

Thread: remoting configuration?!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    remoting configuration?!

    hi,

    i want to use a client activated remote object , i dont know how to configure it, i saw samples in the sdk for server activated objects but didnt fint anything for what i want, can some one please write down how to configure it both using a config file and in code ( both sides please, client and server ), thanks

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    any idea's?!

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Did you try searching this forum first? There should be some useful info, I know I have posted an example before that used client activated objects.

    http://www.vbforums.com/search.php?s...der=descending

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    thanks for the reply,
    the sample project that you posted in one of threads was written in vs2003, i have '02 , can you please copy and paste the config part of the code here?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    this is what i found >>
    for server :
    Code:
      System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(New System.Runtime.Remoting.Channels.Http.HttpChannel(100))
            System.Runtime.Remoting.RemotingConfiguration.ApplicationName = "Amir"
            System.Runtime.Remoting.RemotingConfiguration.RegisterActivatedServiceType(GetType(Client))
    and for the client

    Code:
     System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(New System.Runtime.Remoting.Channels.Http.HttpChannel())
            System.Runtime.Remoting.RemotingConfiguration.RegisterActivatedClientType(GetType(client), "localhost:100/amir")
    the question is where do i define the server type on the client , i have an error where in the client side ( red color ) saying the type client is not defined, what do i have to about that?

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    There is a link in myt signature to convert VS'03 projects to VS'02.

    As for the client type you need to reference the assembly that contains the client type. Remoting requires that both server and client can reference the same assembly with the remoted object, or a common interface depending on the situation.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    i thought the remoting server sends a proxy object of the remoting object to the client , so the client doesnt have to have the class itself. so both sides must have the class of the remoting object, right?!! so you cant just create a remoting application that everyone can use ( like web services ) first you must somehow get the class to the client, is that how it works?

    please help me out here, i getting very confused


    thanks

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    somebody please help me out here,
    so if the client program wants to activate the object on the server ( client activated remoting ) , how do we reference the remote object if there on 2 different computers in the lan?

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You should probably get a decent book on remoting, because there isn't always such an easy answer it depends on details of the project. Depending on the situation the client needs at least the interface of the remot object it will use, in some cases when using CAO it will need the full code of the object. It will need this information locally so you would just have an assembly on that machine that it references.

    I'm not sure what you mean about 2 computers on the lan. You'd reference the one assembly on the current computer.

    A good book on Remoting is 'Advanced Remoting with VB.NET' by Ingo Rammer. It covers the basics as well as advanced despite what the name says.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    i just want client remoting in the simplest form, 1 computer activating an object on a server , so if i copy the remoting class to the clients application and register it with the remoting system, when creating a new object, is it gonna create the object remotlely or is it just gonna be a local instance????

    answering this will pretty much help me in what i'm doing, thanks

  11. #11
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You don't need to register anything client side, you still use remoting to get the object, but you just have a reference to the assembly that contains the type information so it will let you reference the type. Otherwise any reference to the type you want returned from the remoting will give an error. You should check out that example I posted its a simple thing to convert it to vs'20.

    Just to clarify if you have ran your remoting and connected then make a new instance of the remote object it should create it on the server:
    VB Code:
    1. Dim cfname As String = Reflection.Assembly.GetExecutingAssembly.Location & ".config"
    2.         'start remoting by config file
    3.         RemotingConfiguration.Configure(cfname)
    4.         'creates the object on the server
    5.         gFactory = New SecureFactory
    Last edited by Edneeis; Dec 8th, 2003 at 12:55 PM.

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    thanks for the help

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