Print Page | Close Window

Using Coroutines with InvokeServerMethodAsync

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2285
Printed Date: 23-Jan-2026 at 11:30pm


Topic: Using Coroutines with InvokeServerMethodAsync
Posted By: tj62
Subject: Using Coroutines with InvokeServerMethodAsync
Date Posted: 08-Nov-2010 at 7:53am
Is it possible to use Coroutines with InvokeServerMethodAsync(). If so can someone send me an example of how to do that?
I actualy stumble over the callback ... how to yield on that.
 
Regards
  TJ



Replies:
Posted By: tj62
Date Posted: 09-Nov-2010 at 4:03am
Well I found out my self. It is just about yielding at the return value from InvokeServerMethodAsync(), for example:
 
string returnText ="";
var  googleTranslateOperation InvokeServerMethodAsyncString("C2NetServer.RpcMethods,C2NetServer",
                                              "GoogleTranslate",
                                              args => returnText = args.blabla, langId,englishText);
yield return googleTranslateOperation;
yield return Coroutine.Return(returnText);
                                                   



Print Page | Close Window