Help to run this remoting example in .Net

K

Krish

I am referring to the remoting example as described in msdn site.

http://msdn.microsoft.com/library/d...cpguide/html/cpconbuildinghostapplication.asp.


I have the listener running : (I am not sure why we say
"url="http://localhost:8989/RemotableType.rem" where is this file
located
or is it even referenced.

I ran the listener "exe" file and it is waiting for requests. Then I
tried to run the client code, It always brings up the the runtime
debugger.

Has anyone had running the example code, I copied the code from the
site too.

thanks for any help.
 
G

Guest

I have the listener running : (I am not sure why we sa
"url="http://localhost:8989/RemotableType.rem" where is this fil
locate
or is it even referenced

The "url=..." is not a file. It is a URI {Uniform Resource Identifier} that is a well known place where clients will attempt to connect to use your server's services. For example this code could open a TCP socket channel on port 4665 and listen for clients that wish to instantiate and use "MyServer"

channel = new TcpChannel(4665)
ChannelServices.RegisterChannel(channel)
RemotingConfiguration.RegisterActivatedServiceType(typeof(MyServer))
...

The above code could be in the OnStart method of a service process or somewhere in a regular executable. Clients that wish to instantiate and use a remote instance of "MyServer" must know what machine is acting as the server and they must know which port to connect on. Assuming that we were running on a machine named SourceNexus the corresponding client code to instantiate and use "MyServer" would lookmlike this

ChannelServices.RegisterChannel(new TcpChannel())
RemotingConfiguration.RegisterActivatedClientType(typeof(MyServer), "tcp://SourceNexus:4665")
MyServer server = new MyServer()
server.CallSomeMethod()
...

--Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top