Websockets message loss - javascript

When using websockets I noticed some message loss. I am trying to communicate between mobile safari (client) and c#(server). I am using superWebSocket (opensource) as a server, so it might be a server bug...
But the messages are only dropped when the connection is congested (When I send alot of messages). This "reaks" of UDP to me, but I remember reading somewhere that web-sockets are TCP.
Is there any occasion where I might issue a "send" command in javascript, and the receiving side does not get the message?

I've been using WebSockets extensively in with high traffic applications and in situations where a single lost message (in either direction) is fatal. I've never seen any messages lost, ever. However, I do recall seeing a post or question somewhere about the same issue and that person was also using superWebSocket for the server. So my strong suspicion is that there is a bug in superWebSocket.
Do you see the same problem if you use a non-mobile browser? It's possible the iOS brower (I assume that's what you mean by mobile Safari) has a WebSocket bug. I've not extensively tested that browser with WebSockets. I have extensively tested Chrome, Firefox (with WebSocket enabled), and Opera (with WebSocket enabled) on Linux and Windows and Safari on Windows.
There is no occasion where a send in Javascript is allowed to not reach the server except if the whole connection fails. If that is happening then there is a bug somewhere.

Related

net::ERR_NETWORK_CHANGED on Chrome on Https socket connection

I'm running a Server-sent Event (SSE) server over Ingress/Kubernetes/GoogleCloud and it works like a charm. I can run SSE clients over the web and they connect perfectly, start receiving events with no problem.
But there's one ugly bug I can't get it work right, on Chrome browsers after some time I get net::ERR_NETWORK_CHANGED error. No matter how many times I run it, I always get it after a few seconds/minutes.
If I run the same client over Firefox, nothing wrongs happens. If I run it using cURL over terminal, nothing wrong happens.
If I decide to run if over Chrome without HTTPS, it works! I'm only getting it when running it through HTTPS and on a Chrome browser.
Has anyone encountered this before? Seems like a ugly bug for me.
I'm having the same problem but it's sporadic.
From the Chromium project source code: OnNetworkChanged will be called when a change occurs to the host computer's hardware or software that affects the route network packets take to any network server. Some examples:
A network connection becoming available or going away. For example
plugging or unplugging an Ethernet cable, WiFi or cellular modem
connecting or disconnecting from a network, or a VPN tunnel being
established or taken down.
An active network connection's IP address changes.
A change to the local IP routing tables.
Hope it helps
For me using a mac system and chrome for a daily basis, I encounter this problem now and then and finally found it might be helpful to solve this problem by just turning off the virtual machines or dock containers whichever can adjust your network configuration.
Maybe not fit for your case but it could be a hint. I saw a lot of people having this kind of issue with chrome.

Is Chrome microphone supposed to be not working if there is no Internet Connection?

I'm using a JS plug-in called Annyang, a Speech Recognition tool and of course it requires a working mic. Everything works just fine with normal Internet connection, but when I disable my Internet Connection, the plug in won't work at any level. (and I did check the plug-in's JS file and found nothing that needs any Internet Connection to be functioned.
Is Chrome microphone supposed to be not working if there is no Internet Connection ? Or something is wrong with the plug-in..?
Thanks a lot for reading this question. Have a good day :)
It's not the microphone that needs internet connection,
it's google's implementation of speech-recognition API, which sends the recorded data to their server to get the computed STT.
Nothing you can do on your side, not an Annyang bug either.

Cordova hybrid app- HTTP requests are very slow

I am building a hybrid app, with AngularJS, Cordova, Restangular ond client side and Python with wsgiref.simple_server on server side. I am not doing anything special, this is very simply requests like this:
Restangular.one('/devices').get().then(function (response) {
viewModel.devices = Restangular.stripRestangular(response.devices);
});
I set baseUrl for Restangular:
.config(function(RestangularProvider){
RestangularProvider.setBaseUrl('http://192.168.54.102:8000/');
})
And when I use it on local computer with Chrome browser, everything is fast, works normal. But when I use it on Android on Phonegap developer app on device or install app on device with Android, it works crazy slow. It looks like it is send to server with big delay, cause it takes some time as I see debug server log on server side. It occurs also when python application with server is not in debug mode, for example when I start it normally after install on local computer. As I see some people has this problem, does anybody found a solution or a reason, which causes very slow HTTP requests in hybrid application? Thank you in advance for every answer.
Since you are a hybrid developer, I am sure you are familiar with the Chrome DevTools. For me on a Mac, hit cmd + option + i, or go to View -> Developer -> Developer Tools.
The really great thing about Chrome in recent history is it now works with Android WebViews too. Hybrid developers haven't always had this convenience, and had to debug essentially handcuffed using tools like Weinre.
Now we can use the DevTools directly in the Chrome browser while your Android device is connected by ADB from a new tab calling chrome://inspect
Here is some more detailed information on how to do this if you get stuck.
From here open up the network panel and see how long your requests are taking. If they are showing a significantly longer amount of time to load here, the issue has nothing to with Angular, Cordova, Restangular or probably even Hybrid architecture at all. I would check your network and performance elsewhere on the device.
If this is definitely not the issue, I would use the Timeline tab in the DevTools to see what is taking so long between your browser receiving the information and your device displaying it. If there is any significantly longer process taking place in between, you will see it here.

Configuring maximum number of simultaneous open WebSockets (in IE)

I've got this JS application. All client side JS communicating with a third party stream server via web sockets. I have about 18 different web sockets open for one page. Firefox and Chrome handle this many open web sockets at once just fine. IE11 seems to have a limitation of 4 open web sockets at once. Once I open that 5th web socket, regardless of socket call to the third-party server, I get an error thrown by IE, which closes the socket and gives the general error "SecurityError" and expanding the proto section it gives me . Seems to be pretty generic errors from my searches. At first I thought there may be a trusted zone type issue with IE, but I've added the client site to my trusted zone as well as the server providing the data.
This post provides info on max number of websockets for Firefox & Chrome, but I don't see anything specific about IE. Are there any known limitations to IE and web sockets? Answered, see edit below.
This MDN site talks about increasing the max value, but again, I can't find anything about IE. Is there some IE setting to up the amount of open connections? Answered: see below edit.
EDIT: This site shows the max connections settings for IE. It looks like it's a registry setting in Windows that controls the amount of web socket connections. Interestingly enough, I don't have that registry Key anywhere, but there is still a limit for this. The page speaks of IE10, and I'm working with IE11 specifically. Does anyone know if there are registry settings for this in regards to IE11? Has anyone just added these feature web socket registry keys and solved this issue?
The MSDN documentation you referenced is clear on the default being 6 concurrent connections (which means if not specified in the registry, that's what you'll get); and, if the documentation doesn't specify differently, it's probably safe to assume newer versions of Internet Explorer act in the same way as version 10.
Try setting through group policy. It worked for me.
https://jwebsocket.org/documentation/reference-guide/internet-explorer-tips

WebSocket: onMessage() only triggered at the end when server is closing connection

I have a weird error that I can not solve.
My implementation WebSocket works perfectly. The browser connects to the server, exchange their keys and the connection is fully established! The server starts sending messages to clients (visible in the network traffic).
But on my PC, all browsers (Chrome, Firefox, portable or not), the "onMessage ()" is correctly interpreted ... but only at the end when I turn off the server! In other words, if I put an alert () to each onMessage (), during exchange, I did absolutely nothing. But once I cut the server, I receive all alerts at once!
Yet on my MacBook everything works perfectly.
This ironic is it that behavior that affects all of my browsers on my PC. I run under Windows 7.
Thank you in advance ;)
I've finally found the issue !
If you have some troubles with Websockets, just disable the SSDP discover service on Windows.
net stop SSDPSRV
I ran into a similar issue recently. web server runs a separate SSDP discovery process to find uPnP devices on the network. When I had SSDP enabled, my websocket connection was always closed. Disabling SSDP solved it. But I haven't had a chance to investigate why.

Categories

Resources