Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Remoted Objects Dynamically

Status
Not open for further replies.

Milby7

Programmer
Dec 5, 2003
67
GB
I have a scenario where I need a client application to be able to locate instances of remoted objects running in a server application @ runtime (mainly IPC on single pc).

I'm trying to write a little test app which is just meant to get the idea to work. The server app would register a channel named "MyTest1" to share the remoted object. You could then load another server app up which would register a new channel named "MyTest2" on another port, then possibly another named "MyTest3" etc. If a client app wanted to locate an object instance from one of these server apps it would search through registered channels for one named "MyTest1", or "MyTest2" depending on which one it wanted, get the server port & ultimately get a reference to the remoted object shared by whichever server app instance it chose. However!! When i tried this, there weren't any registered channels available to the client app. I take it that's because ChannelServices.RegisteredChannels only lists those channels registered by the calling process which in this case would be the client app!?

I guess my question is how would i be able to do something similar to the above? With each TcpServerChannel uniquely identifiable to client applications. Or at least some means of identifying one from the other.

Any help would be REALLY appreciated.

p.s. If you need any more info then let me know!!
 
You have 3 separate processes that are trying to communicate with eachother?

you really need 1 common place to access the info.

Create your main entry server:

HostingServer
-RegisteredServer1
-RegisteredServer2
-RegisteredServer3

Then you ask for HostingServer for the location of the registered server. Port, Address, Etc.

But you need that one entry point that could potentially connect you to the correct server.


Is this on the right track?
 
Say for example there could only ever be one server application then there wouldn't be a problem, as any client applications would never have to worry about which server instance they were communicating with/using. If there's more than one server instance, & communication is private between each client and server instance, then how could you distinguish one server session from the other (most importantly the objects it provides via remoting).

[purple]
Server01 [grey](Provides objects via remoting)[/grey]

Client01 [grey](Only cares about Server01)[/grey]
Client02
[/purple]
[blue]
Server02 [grey](Same objects, different session)[/grey]

Client03 [grey](Only cares about Server02)[/grey]
Client04
[/blue]

I hope this helps!?
 
Please ignore the [grey] bits, i pressed the submit post button rather than the process tgml link. Doh!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top