public Form1() { InitializeComponent(); //************************************* TCP *************************************// // using TCP protocol // running both client and server on same machines TcpChannel chan = new TcpChannel(); ChannelServices.RegisterChannel(chan); // Create an instance of the remote object remoteObject = (MyRemotableObject)Activator.GetObject(typeof(MyRemotableObject), "tcp://localhost:1001/HelloWorld"); // if remote object is on another machine the name of the machine should be used instead of localhost. //************************************* TCP *************************************// }
public Sunucu() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; remotableObject = new MyRemotableObject(); //************************************* TCP *************************************// // using TCP protocol TcpChannel channel = new TcpChannel(1001); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyRemotableObject), "HelloWorld", WellKnownObjectMode.Singleton); //************************************* TCP *************************************// UzakNesne.Cache.Attach(this); }