|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Activator.GetObject Method (Type, String)This method does not fail if the site is not running! Is there a way to
check the proxy for failure? Thanks Tom Tom,
What do you mean if the site is not running? Can you post an example? -- Show quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com <newscorrespond***@charter.net> wrote in message news:%Wvug.401$OM.68@fe07.lga... > > This method does not fail if the site is not running! Is there a way to > check the proxy for failure? > > > Thanks > Tom Yes
// start the process to talk to Process TrackersProcess = Process.Start(@"some good thing to starg", TrackerBuilder.ToString()); // set me up to send ClientChannel = new IpcClientChannel(); ChannelServices.RegisterChannel(ClientChannel, true); WellKnownClientTypeEntry remoteType = new WellKnownClientTypeEntry(typeof(MTGClassLibrary.MTGTracksMessage), TrackerURL); RemotingConfiguration.RegisterWellKnownClientType(remoteType); // here is the example MessageTracker = (MTGTracksMessage) Activator.GetObject (typeof(MTGClassLibrary.MTGTracksMessage), TrackerURL); If I comment out the start process the GetObject still works. newscorrespond***@charter.net wrote:
Show quote > Yes This is by design. Activator.GetObject> > // start the process to talk to > Process TrackersProcess = Process.Start(@"some good thing to starg", > TrackerBuilder.ToString()); > > // set me up to send > ClientChannel = new IpcClientChannel(); > ChannelServices.RegisterChannel(ClientChannel, true); > WellKnownClientTypeEntry remoteType = new > WellKnownClientTypeEntry(typeof(MTGClassLibrary.MTGTracksMessage), > TrackerURL); > RemotingConfiguration.RegisterWellKnownClientType(remoteType); > > // here is the example > > MessageTracker = (MTGTracksMessage) Activator.GetObject > (typeof(MTGClassLibrary.MTGTracksMessage), TrackerURL); > > If I comment out the start process the GetObject still works. does not actually connect, it only returns proxy object. Connection is established at the moment first remote call is made ("lazy connect"). That was bad desing decision IMHO, but it is as it is. You could implement dummy method ("Ping()") on your remote object on which you can check (and force) connection. Regards, Goran That was the way I read it but I often miss the obvious.
Thanks |
|||||||||||||||||||||||