BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["port"] = 0;
TcpChannel channel = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(channel, true);
RemotingConfiguration.RegisterWellKnownClientType(typeof(RemotingClass), "tcp://localhost:8086/Test");
RemotingClass rc = new RemotingClass();
MyHandler mh = new MyHandler();
rc.RemoteEvent += new RemotingEvent(mh.REvent);
События в .NET Remoting
Заранее благодарен.
код клиента
Код:
код сервера
Код:
BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props=new Hashtable();
props["port"] = 8086;
TcpChannel channel = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(channel, true);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemotingClass), "Test", WellKnownObjectMode.Singleton);
provider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props=new Hashtable();
props["port"] = 8086;
TcpChannel channel = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(channel, true);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemotingClass), "Test", WellKnownObjectMode.Singleton);