Yes this would be ideal ... but not in case of client channel sink. When I get 
asyn response from the server AsyncProcessResponse is called, There I need to 
perform some operations and call next sink to process the message with:
nextSink.AsyncProcessRequests() however this doesn't return any state at all :( 
and I don't have access to any methods that would End this processing (a'la 
EndInvoke)
Typically you do something like this:
1) Create a class like:
public class MyAsyncResult : AsyncReult
{
 internal Exception SavedException;
}
2) When the user starts an asyncronous request, instantiate one of those 
classes and return it as the IAsyncResult.
3) Keep a reference to this object during your asynchronous processing
4) If an exception is thrown, store it in the SavedException property and 
complete the request (typically set AsyncResult.Complete =true, signal the wait 
handle and invoke the AsyncCallback if one was supplied)
5) This should result in the user calling the EndXXX method and pass in the 
IAsyncResult that you created at the start
6) Just check if SavedException != null, and if that's true, rethrow the 
exception
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to