c# - How to access remote object from other computer in remoting -


i have server object

 tcpchannel tcp = new tcpchannel(1234);         channelservices.registerchannel(tcp, false);         string s = configurationmanager.appsettings["remote"];         remotingconfiguration.registerwellknownservicetype(typeof(testremoting.initialclass1), "testremoting", wellknownobjectmode.singleton);         console.writeline("server running on 1234 channel...");         console.writeline("press enter stop");         console.readline(); 

and accessing object in mu client form like

 initialclass1 icls = (initialclass1)activator.getobject(typeof(initialclass1), "tcp://localhost:1234//testremoting"); 

now keeping remote object in computer. how can access server object computer. if access server object (local) computer, use

"tcp://localhost:1234//testremoting"

i using localhost here, because server object , client same. if 2 different, how can access server object. tried computer ip as

tcp://200.100.0.52:1234//testremoting 

that time getting exception

a connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond 200.100.0.52:1234 

the message means of time client cannot find service. can use following steps determine connection fails:

  1. check if service running on remote machine.
  2. check if port number correct.
  3. ping remote machine client.
  4. open telnet session remote machine on port number of service.

the step on fails gives indication of why failing.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -