Wrap client side callback to async - await

0 votes

I'm using .net client, C# code

To call a service on the server (i.e. GetLiveRoomInfo) , the client has to do following steps

- On the UI button click event, call WarpClient.GetInstance().GetLiveRoomInfo

- Wait for onGetLiveRoomInfoDone event callback

- Update the UI data from the callback using Invoke

 

That's seem too much overhead code if you make multiple different calls to the server

Is it possible to wrap all the call in a single method call, something like this

UI_OnButton_click ()

{

await  WarpClient.GetInstance().GetLiveRoomInfo

Update more UI data here ...

}

Thanks.

 

asked Feb 20 in AppWarpS2 by Manhson Tran (10 points)

1 Answer

0 votes
Hi,

The Server calls involved in AppWarp is socket level calls where client has to listen to certain port for receiving any message from the server. It can only be done asynchronously in background so that it does not block your main thread. That is why we have provided separate callbacks for recieving the data for any requests made by client. It improves the user experience and it does not create any app hang scenario.

Please let me know if you have any further queries.

Thanks.
answered Feb 21 by rajeev.etc (1,498 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
Migrate from Parse to ShepHertz App42
...