How to detect socket.io connection mode - websocket

So, I'm debugging a web app that uses socket.io on an iPad tablet.
Connected to the Internet through the same router as my deskop computer, I noticed packets take much longer (up to 3 seconds longer) to arrive to the iPad browser (both Chrome 56 and Safari 10) compared to how fast they arrive to my desktop browser (Chromium 56).
So I figured, maybe socket.io is using long-polling for some reason on the iPad, and WebSockets on my desktop computer.
Safari and Chrome for iOS obviously support WebSockets, so I want to first confirm this theory and then find a way to stop long-polling and use WebSockets.
In order to test this theory, I need a way to find out whether the app is using long-polling or WebSockets, but I don't have access to remote debugging tools for iOS (i.e. a Mac or Windows computer).
Does socket.io provide an interface I can use to probe what connection mode it's currently using?

Related

What can I use to view a mobile device remotely instead of VNC options which are too slow?

We have a dozen or so mobile devices for testing. Emulators in SDK's like Android's or Xcode have quirks. So, we use actually devices.
I've tried browser synchronization like browser-sync but that routes everything through a proxy.
I'm looking for a way to remotely view and control these devices from a desktop. I've tried running a VNC server on the mobile devices, but VNC is just too slow. Not to mention, the devices themselves lack any real processing power.
Any ideas?
You can try seeTest Manual tool http://experitest.com/support-2/seetest-pricing-manual/. It is a free tool. Very easy to install and setup.
You can remotely connect and control your android and iphone devices from PC. It is just like interacting with the mobile phone from desktop.

iOS and Android bluetooth connection differences

Just curious to understand why iOS devices connect to sphero directly but an app needs to do it in Android?
Well that's what I guess is happening because sphero will keep flashing in identity colours in Android until an app completes a connection.
To add: to use the option that keeps the sphero alive on the charger while connected to the client, then IOS would not need an app running but Android would. Well the Android app could have a service running to keep a connection open with sphero.
But ideally a consistent behaviour would be better.
Kasuku, you're correct in your post, but you also need to consider that the operating systems that you are comparing are completely different. For example, in Android it is possible to directly access the bluetooth adapter and "manually" connect to a bonded device. In iOS, this functionality is abstracted out from the developer.
To address BTLE:
No, as of right now Sphero currently does not support BTLE hardware.
OK ... as usual this tag seems to be dead so I post my finding anyway:
Bluetooth hardware that wanted to connect to IOS, but were not following one of the standard profiles (e.g. headsets), need to conform to Apple's proprietary MFI (Made for IOS) protocol. So the connection is established by the IOS system and then it allows apps to access this connection.
But now newer IOS devices support Bluetooth LE so the MFI restriction no longer applies. I think Sphero2B is going to use this. Current Sphero hardware probably doesn't support BT LE. My next question is ... does sphero hardware support BT LE? ... but I'm not going to ask on this forum:)
Android on the other hand allows apps to negotiate the connections to paired devices.
Here's a link with more info:
Some blog

WP7 Debugging without Tethering over USB?

i want to Debug some Networkproblem cases in my Application. But i can't really test it because my Phone has internet over USB. If I disconnect it from USB i can't debug... So is there anyway, I can disable the Tethering over USB on my Phone?
Edit: I have a HTC Trophy but it's the same with the Lumia 800 of my friend...
Assuming that you're connecting to a web service which isn't running on your machine, you can test this by disconnecting your PC from any network which gives it access to the internet (i.e. turn off wifi on the pc or pull the network cable.)
It's not an elegant solution or one that can be easily automated but it works. ;) (I used this method with testing an app which would progressively download large files in pieces and would stop and then resume as connectivity was lost and restored.)
You also can use Fiddler http://www.fiddler2.com/fiddler2/ as a Proxy for your emulator to simulate lossy connections or no connection at all. This way you can still surf and look for references while you code :-)
edit: fiddler doesnt seem to work for the Emulator(for more information, look into the comments), but if you want to simulate a lossy Connection then this is the way to go, even work for phones with the connection-cable.

How can I sniff local traffic

I have WAR app A that calls app B. I want to sniff traffic between them. How can I do it? OS: Windows
Wireshark (http://www.wireshark.org/) is a useful tool for sniffing network packets. I had this kind of problem yesterday (although it was between a windows app and a device on the network). I had never used Wireshark before then, but I was able to use it and read through the data in a matter of minutes. I haven't tried it between two apps on the same machine, however.

Windows Phone - Application crashes when disconnected from PC

Whenever I disconnect my Windows Phone from PC (connected through USB) and if my application is running, my application hangs for sometime and then application crashes.
Does anyone experienced same behavior? I guess switching for PC connection to Wi-Fi/GPRS is causing the issue.
the windows Phone Requires that you Safely Remove hardware first, after a few times when i started Development on the windows phone i did the same and Ended up getting a new Phone. So plainly put, try to Safely Remove and Make sure it is installing the app to the Device.
Meaning if you Remove the phone, the App is still able to be ran just like a normal downloaded App form the Market place.
if you want more in depth information, i would suggest Reading the WP7 Everything Programming ebook lol
its filled with good information, and Definitely Helped me along my road to Love DEV for WP7.
As gamernb says, if you disconnect the USB from a properly tethered Windows Phone (i.e. connected to Zune, or using the WPConnect utility), the phone's network connection will be reset and your app's connections will be terminated. The phone will then start trying to connect using WiFi or cellular data (if they are on), but this can take quite a while.
You will have to handle this network disconnection in your app - I've found that pulling the USB cable in this way is a good ad-hoc test for WP7 apps: do an action which you know will use the network connection. Then watch if the app crashes, or handles this gracefully.
Actually you aren't guaranteed to always use the PC data connection: if you make sure that the computer has no data connection (i.e. pull the Ethernet cable, turn off WiFi etc ), the WP7 app can then use cellular data or WiFi on the phone instead.
Alas-
you could set perimeters in your application to Check what the connection type is, then Make changes accordingly.
You May have a slight freeze, but that's better then a crash....mainly when the phone switches from PC to WWAN, their would be a slight Pause.
use the Reachability Class and NSLog to Figure out whats going on exactly.
I really hope that helps!

Resources