|
-
Dec 7th, 2003, 11:19 AM
#1
Thread Starter
Addicted Member
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
-
Dec 8th, 2003, 12:57 AM
#2
Thread Starter
Addicted Member
-
Dec 8th, 2003, 01:15 AM
#3
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
-
Dec 8th, 2003, 02:39 AM
#4
Thread Starter
Addicted Member
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?
-
Dec 8th, 2003, 03:25 AM
#5
Thread Starter
Addicted Member
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?
-
Dec 8th, 2003, 03:39 AM
#6
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.
-
Dec 8th, 2003, 03:49 AM
#7
Thread Starter
Addicted Member
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
-
Dec 8th, 2003, 06:49 AM
#8
Thread Starter
Addicted Member
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?
-
Dec 8th, 2003, 10:50 AM
#9
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.
-
Dec 8th, 2003, 12:31 PM
#10
Thread Starter
Addicted Member
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
-
Dec 8th, 2003, 12:50 PM
#11
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:
Dim cfname As String = Reflection.Assembly.GetExecutingAssembly.Location & ".config"
'start remoting by config file
RemotingConfiguration.Configure(cfname)
'creates the object on the server
gFactory = New SecureFactory
Last edited by Edneeis; Dec 8th, 2003 at 12:55 PM.
-
Dec 8th, 2003, 02:03 PM
#12
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|