Fraage zu Code (.net Remoting)
-
Hey ...;)
// (A) KANAL ÖFFNEN IDictionary props = new Hashtable(); props["name"] = strChannelName; props["port"] = iPort; BinaryServerFormatterSinkProvider srv = new BinaryServerFormatterSinkProvider(); srv.TypeFilterLevel = TypeFilterLevel.Full; BinaryClientFormatterSinkProvider clnt = new BinaryClientFormatterSinkProvider(); HttpChannel chan = new HttpChannel(props, clnt, srv); ChannelServices.RegisterChannel(chan, false); // (B) Remote objekt über den Kanal sharen... RemotingServices.Marshal(m_RemObj, remoteobj.rem", typeof(RemoteDataExchange)); // (C)KANAL SCHLIESEN ChannelServices.UnregisterChannel(chan);
Soo, woher weis die RemotingServices.Marshal methode, das ihr objet über den kanal (A) geshared wird? Weil zwischen ChannelService und Remotingservices steh ich keinen zusammenhang.
-
Im Client Code machst Du die Verbindung zwischen Objekt und Kanal über die URI.
Simon