New Posts New Posts RSS Feed: Using Coroutines with InvokeServerMethodAsync
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Using Coroutines with InvokeServerMethodAsync

 Post Reply Post Reply
Author
tj62 View Drop Down
Groupie
Groupie
Avatar

Joined: 21-May-2009
Location: Iceland
Posts: 81
Post Options Post Options   Quote tj62 Quote  Post ReplyReply Direct Link To This Post Topic: Using Coroutines with InvokeServerMethodAsync
    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
Back to Top
tj62 View Drop Down
Groupie
Groupie
Avatar

Joined: 21-May-2009
Location: Iceland
Posts: 81
Post Options Post Options   Quote tj62 Quote  Post ReplyReply Direct Link To This Post 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);
                                                   
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down