PC Review


Reply
Thread Tools Rate Thread

Activator.GetObject Method (Type, String)

 
 
newscorrespondent@charter.net
Guest
Posts: n/a
 
      16th Jul 2006

This method does not fail if the site is not running! Is there a way to
check the proxy for failure?


Thanks
Tom
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      16th Jul 2006
Tom,

What do you mean if the site is not running? Can you post an example?


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

<(E-Mail Removed)> wrote in message
news:%Wvug.401$(E-Mail Removed)...
>
> This method does not fail if the site is not running! Is there a way to
> check the proxy for failure?
>
>
> Thanks
> Tom



 
Reply With Quote
 
Tom Spink
Guest
Posts: n/a
 
      17th Jul 2006
(E-Mail Removed) wrote:

>
> This method does not fail if the site is not running! Is there a way to
> check the proxy for failure?
>
>
> Thanks
> Tom


Hi Tom,

Are you talking about remoting? Can you provide a code sample?

--
Hope this helps,
Tom Spink

Google first, ask later.
 
Reply With Quote
 
newscorrespondent@charter.net
Guest
Posts: n/a
 
      17th Jul 2006
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.
 
Reply With Quote
 
Goran Sliskovic
Guest
Posts: n/a
 
      17th Jul 2006
(E-Mail Removed) wrote:
> 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.


This is by design. Activator.GetObject
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
 
Reply With Quote
 
newscorrespondent@charter.net
Guest
Posts: n/a
 
      17th Jul 2006
That was the way I read it but I often miss the obvious.

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activator.GetObject() does not work when called via COM mkadlec99@gmail.com Microsoft C# .NET 1 26th Oct 2006 03:27 PM
Activator.GetObject Method (Type, String) newscorrespondent@charter.net Microsoft Dot NET Framework 5 17th Jul 2006 01:34 PM
GetObject method not work after Call Shell Method =?Utf-8?B?YmVu?= Microsoft Excel Programming 8 21st Feb 2006 03:45 PM
VS2002 to 2003 Activator.GetObject Help! =?Utf-8?B?cmx1bQ==?= Microsoft Dot NET 0 16th Jan 2004 01:56 PM
Activator.GetObject sucks pokémon Microsoft C# .NET 1 15th Sep 2003 10:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.