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)
Alright I understand that though I still think it makes more sense to return an error if the connection is lost before a callback is received as the call was not successful and this makes it easier for the developer similar to how if you make an API call while there is no connection you get an error callback. Also even if I saved state and restored it and then made the same api call when I got reconnected it wouldn't work because I keep getting disconnected (the other issue I mentioned) it would end up in an infinite loop and never continue like so: CreateRoom->Connection Error->Recover->CreateRoom->Connection Error->Recover etc...

In any case, there is definitely an issue with the AppWarp WinRT SDK because it cannot maintain a connection when I set the network speed to 2G Poor, I should not be getting disconnected and having to recover just because the network is slow since I am not actually losing my internet connection. It seems like there is some timeout period that keeps expiring in the SDK and it thinks the connection is lost because the response is coming back too slow.

Also, I don't have the same loss of connection issue when using the Windows Phone 8 version of the SDK with the same 2G Poor connection speed so there is definitely something in the way the AppWarp WinRT SDK is implemented. I should be able to maintain a connection to AppWarp even if my connection is as slow as a 2G network with Poor signal as long as I am not actually losing my internet connection.
Hi Feraask,

Our winRT SDK works on a WinRT socket that is supported by your network connection.A break in the connection can either be a result of a bad network or a problem with the socket.AppWarp SDK provides APIs to exchange data between client and the server.The SDK is built keeping in view the requirements of a large group of users so it does not maintain a timeout session for the missed API calls.Somteimes, it is difficult to detect to detect a break in the connection instantly on some target devices.So, our SDK maintains a KeepAlivesTimer to check the connection status in every 2 seconds.

We value your concern regarding the SDK and we are anyways going all over through the AppWarp WinRT SDK to provide you with the best support for the SDK.

Thanks

AppWarp Team
Alright thanks for that clarification, so is there anyway to get it the WinRT SDK to work with a connection that is as slow as 2G with poor signal strength since it works fine using the AppWarp SDK for Windows Phone 8 is there a way you guys can possibly update the WinRT version to work in a similar manner to the Windows Phone 8 version? I just want to make sure that even users with a very slow connection can still use my app.
We are working on the AppWarp WinRT SDK for any possible reforms.
So are there any updates in regards to fixing the slow connection issues? It is critical that the SDK still functions even on slower connections in order to ensure a good user experience.
Is anyone from AppWarp still following this thread? I believe this is a critical issue that should be fixed since the SDK does not work on slower connections.
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
...