AppWarp WinRT Slow Connection Issues

0 votes

Hello,

I am developing an application for Windows Phone 8.1 using the AppWarp WinRT SDK and I have noticed 2 issues when I test my code simulating a slower network in the Windows Phone 8.1 emulator (by going to additional tools page - the icon of the 2 little arrows pointing to the right on the side of the emulator - and under the network tab setting the Network speed to 2G and signal strength of Poor i.e. to simulate the worst possible network conditions).

The first issue I have noticed is that I am unable to maintain a solid connection to AppWarp. After I simply connect to AppWarp I end up losing connection and then recovering repeatedly with no end. So it seems that the AppWarp WinRT SDK is unable to function under this network speed, is there a way to fix this?

Secondly, if I try calling any AppWarp API's such as CreateRoom during the period I still have connection and then I lose connection before I get the onCreateRoomDone callback I never receive the callback and my code cannot continue since it is waiting for a success or failure onCreateRoomDone callback. Can the SDK please be updated so that if the connection is lost before a callback is received we get an error callback with some sort of error as the WarpResponseResultCode instead of just never getting a callback at all (this issue actually occures even if the connection is not slow, it is just more prevalant when the connection is slow as there is more time for connection issues to happen before receiving a callback and the connection itself is not stable)?

You can find my test code here, all you need to do is replace the apiKey and secretKey in the AppServices.cs file and then run the code in the emulator with the network settings I mentioned above and hit connect and wait, it should end up losing connection and recovering repeatedly:

https://bitbucket.org/feraask/appwarptest_winrt/get/804e933fb70a.zip

Lastly, here is an image of another test I ran where I simply added a CreateRoom call to the OnConnectDone callback (if it was successful) to create a room to show that the onCreateRoomDone callback is never received after the connection is lost and also it shows the losing of connection and recovering issue as well:

https://bitbucket.org/feraask/appwarptest_winrt/downloads/AppWarp%20Create%20Room%20No%20Callback%20Error.png

 

asked Jan 15, 2015 in AppWarp by feraask (45 points)

1 Answer

0 votes
Hi Feraask,

Our AppWarp SDKs are designed to offer generalised functioning to all its users.It helps to offer flexibility to them while using the APIs.The speed of the app will directly depend upon the network used.If a network is slow, the SDK will respond accordingly.A break in the connection is due to the network problem and not because of any SDK issues.When a connection is broken, recoverConnection will be called automatically if recovery allowance time has been set between 0 and 120.And if the connection was unable to be recovered within the specified time, recoverConnection will be called repeatedly unless a connection is successfully made.The Recovery Allowance in the SDK is offered for such network related problems.The SDK will not respond if the connection is not recovered.

Ideally, your app should maintain its state each time an API is called which expects a callback from the server, to avoid information loss, in case of a connection problem.

For example, you call the CreateRoom API when the conection was available.But just after that the connection is lost.In such a case, OnCreateRoomDone will not be received as the connection is not available.For this you can save the state whenever you receive a connection error and as soon as the connection is recovered, you should again call the last API which was saved alongwith the state.This way you will not lose any important information.

Thank you

AppWarp Team
answered Jan 15, 2015 by kanika mittal (50 points)
Hi Feraask,

We apologize for a late response to your comment.Incidentally, our team is busy with some urgent project and so we could not get time to get back to you.
The AppWarp SDK for WinRT uses  a number of asynchronous method calls for exchanging information with the server.Due to this, when we repeatedly call connect and disconnect APIs at very short intervals,at some point of time,parallel threads start building and running which gives the AUTH_ERROR.Although we have tested the problem and it is not reproducible easily but on 3-4 times running the program,the bug can be reproduced.Actually the threading issue in WinRT is very deep rooted and needs dedicated time to trace the exact problem.We will try solving the issue as soon as we get time.
As per now,we can share our SDK source code with you if you wish to dig into the code yourself and try to solve the problem.

Thanks
I understand it can take time to find some problems it has just been a while since I heard any response so I wanted to know if anything had changed.

Do you have any progress on the slow connection issue where I lose connection to AppWarp even though my internet connection has been solid just very slow?

If you can send me the SDK source code that would be great as I can try to look through it as well and solve all my problems.

Thanks for the all the help so far.
Hi Feraask,

Please find the SDK source code below :
https://drive.google.com/a/shephertz.co.in/folderview?id=0BzYAF0ad076xTWRiRXY4VGthZmM&usp=sharing

The problem of slow connection is irrespective of the server.In our SDK, we use a keepAlivesTimer which runs 3 times for every 2 seconds so as to check for a connection.But when it does not get the connection for 6 seconds then the user is disconnected from the server.This must be the problem with your connection.

Anyhow,you can try your hands with the SDK source code for a quick improvement.

Let us know if you face some other issues.

Thanks
AppWarp Team
As I mentioned in the first post I am only simulating a slow connection in the emulator by changing the network settings on the emulator and if I turn off this slow network simulation it works fine with my internet connection. You can try the project that I posted and just follow the steps and see that if you simulate the network speed as a Poor 2G signal the connection keeps getting lost. I think that the connection is just too slow that it takes more than 6 seconds to get a response and check that the connection is still alive so the SDK thinks the connection is lost. Now I am not sure if by setting this simulation mode if it simulates a loss of signal but I don't think so as the device is only simulating a poor/weak signal strength not 0 signal strength.

Anyway, If you guys can keep looking into all the issues that I have found as well that would be really great. I will try my best to take a look at the source code and fix them but I'm sure it will take me a much longer time than you guys to grasp exactly how everything is done in the code so I can actually make meaningful changes. I have requested access to the code using the link you posted so if you could grant it for me I would appreciate it.

Thanks.
We will definitely look into this matter as soon as we get time.Till then you can go through the source code shared with you.We have mailed you the source code on your gmail id.
One thing I would suggest is to test the above connection problem on a device if possible because it has been observed that most of such connection issues occur while testing the app on simulator.Whereas if you test the same app on a device with the same 2G network,it might work properly.

Thanks
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
...