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 / CLR / October 2005

Tip: Looking for answers? Try searching our database.

using AppDomain.DoCallBack() asynchronously?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
john conwell - 05 Oct 2005 18:17 GMT
if i want to call into another AppDomain with messing with Remoting, i can
use the AppDomain.DoCallBack() passing in a CrossAppDomainDelegate.  But this
executes synchronously.  Is there a way i can call into another AppDomain
asynchronously, but without having mess with Remoting?
Robert Jordan - 05 Oct 2005 18:29 GMT
> if i want to call into another AppDomain with messing with Remoting, i can
> use the AppDomain.DoCallBack() passing in a CrossAppDomainDelegate.  But this
> executes synchronously.  Is there a way i can call into another AppDomain
> asynchronously, but without having mess with Remoting?

The only thing you need is a MarshalByRefObject from the
another domain. Then you can simply "callback" using a
method of that MBR.

Rob
Jon Shemitz - 05 Oct 2005 21:45 GMT
> if i want to call into another AppDomain with messing with Remoting, i can
> use the AppDomain.DoCallBack() passing in a CrossAppDomainDelegate.  But this
> executes synchronously.  Is there a way i can call into another AppDomain
> asynchronously, but without having mess with Remoting?

create a delegate to the method that calls DoCallBack, and execute it
asynchronously. or use ThreadPool.QueueUserWorkItem.

Signature

i'm midnightbeach.com and a mtn bike
accident means i'm left handed until mid october,
so please pardon lower case and terseness.

john conwell - 05 Oct 2005 21:57 GMT
Right, but then that delegate will execute in the main appdomain, not the
newly created appdomain.  

Or do you mean call DoCallBack to get into the new appdomain, and then once
in the new appdomain, make an async delegate call to kick off the new thread.
that would do what i want.  Then the main thread would return back to the
main appdomain and there would be a new thread running in the new appdomain.

well, either way you meant you got me in the right direction :-)
thanks,
John

> > if i want to call into another AppDomain with messing with Remoting, i can
> > use the AppDomain.DoCallBack() passing in a CrossAppDomainDelegate.  But this
[quoted text clipped - 3 lines]
> create a delegate to the method that calls DoCallBack, and execute it
> asynchronously. or use ThreadPool.QueueUserWorkItem.

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.