Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Activator.GetObject Method (Type, String)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
newscorrespondent@charter.net - 16 Jul 2006 19:52 GMT
This method does not fail if the site is not running! Is there a way to
check the proxy for failure?

Thanks
Tom
Nicholas Paldino [.NET/C# MVP] - 16 Jul 2006 23:43 GMT
Tom,

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

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> This method does not fail if the site is not running! Is there a way to
> check the proxy for failure?
>
> Thanks
> Tom
newscorrespondent@charter.net - 17 Jul 2006 00:15 GMT
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.
Goran Sliskovic - 17 Jul 2006 00:24 GMT
> Yes
>
[quoted text clipped - 16 lines]
>
> 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
newscorrespondent@charter.net - 17 Jul 2006 13:34 GMT
That was the way I read it but I often miss the obvious.

Thanks
Tom Spink - 17 Jul 2006 00:08 GMT
> 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?

Signature

Hope this helps,
Tom Spink

Google first, ask later.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.