At least half of the time, when a client loads my Meteor app, it can't connect to the server.
If I run this in the console:
Deps.autorun(function() {
console.log(Meteor.status());
});
I can see that the client is connecting, disconnected, reconnecting repeatedly.
If I open the Network tab in Chrome's dev tools I can see that about every second or two, another WebSocket request is made.
What could be causing this?
Did you try disabling WebSockets? Try running your meteor app with following env variable
export DISABLE_WEBSOCKETS=true
This suggestion was posted by Arunoda on CodersClan.
Related
From the console it keeps loading some resources:
2022-01-23T15:53:26.686Z:Alerts.Screener.Dispatcher:Error: Receive screener alerts snapshot timeout: 4 main_chart.3a34030d94c5f1691fc6.js:792:2438
Firefox can’t establish a connection to the server at wss://prodata.tradingview.com/socket.io/websocket?from=chart%2FbRlnkhT8%2F&date=2022_01_21-11_27. bRlnkhT8:18:1051
Firefox can’t establish a connection to the server at wss://prodata.tradingview.com/socket.io/websocket?from=chart%2FbRlnkhT8%2F&date=2022_01_21-11_27. bRlnkhT8:18:1051
Firefox can’t establish a connection to the server at wss://pushstream.tradingview.com/message-pipe-ws/private_fzrUpGntAl3EC9SLyKFu9IgriCd-LHOlDBDcaLQrEaM. main_chart.3a34030d94c5f1691fc6.js:795:237
The connection to https://charts-storage-notifications.tradingview.com/charts-storage/layout/bRlnkhT8/subscribe?jwt=eyJhbGciOiJSUzUxMiIsImtpZCI6IkFod2IiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJ0dl9jaGFydCIsImlhdCI6MTY0Mjk1MDAwMCwiZXhwIjoxNjQzODE3NjAwLCJ0eXBlIjoib3duZXIiLCJsYXlvdXRJZCI6ImJSbG5raFQ4Iiwib3duZXJJZCI6OTkyNTg3Niwic2hhcmVkIjpmYWxzZX0.f0rT-t4YKZqSRJ0TY3_kjz0dkmO-hQyvg97MqrgnyOHiRezyM32-ESOmtsX8XsjmUF53bFcZKGW6NAgBWCoueMi8dN3_N4eohGLxfUIJxv_nIMkDWPbVXYNHJgNEVq8H8GmaAzSQVhjNurVbo-NB1ObVhMw8BmOSk_PrIk4yA8Dqf3Icr5f-Yas0btyBmu6M8g1pwAK_tChr6SUb6kZV0WyUivEgxulM5TuYQTK4Pwp9TyQPuVFQh1P0Uv1_aq0oWC_Iwf9PyPn4vKZdvNsFuWWknp1xxAHk69P0ck-feLO4Giay5TR1q5xvYLYXx9dTRsmy1nj_3DXKF6EaJpRPIw was interrupted while the page was loading.
The version is : 96.0.2
Chrome is working well on the same device.
Disabling "NSURLSession WebSocket" resolves the issue for me. Had a similar issue but on safari
last week I started to develop apps for a Samsung Smartwatch with the Tizen SDK 2.4.0. My sample web application connects to a remote Websocket server (a simple echo server) and sends some random requests and prints the received messages (Server is http://www.websocket.org/echo.html). This works fine on an emulated devices as well as on the real Gear S2 Smartwatch (Example was taken from https://developer.tizen.org/zh-hans/development/tutorials/web-application/w3chtml5supplementary-features/communication/websocket?langredirect=1)
But as soon as I start a Websocket server in my home LAN I run into problems. The server is launched via a simple Python example I found on Github (https://github.com/dpallot/simple-websocket-server). The emulator device from the SDK connects to this server without any problems using the local IPv4. But the real device, which is logged in to the same WiFi access point, doesn't.
Note that the connection between my PC and my watch device works fine, since the SDK flashes the developed apps via WiFi to the device.
In my config.xml all connections are allowed
<access origin="*" subdomains="true"></access>
and the privilege for "Internet" is available.
The logs show that the watch tries to open a connection, but is then stuck. No error message is printed - the watch just does not go beyond the initial creation of the websocket.
Do you have any hints or thoughts about how I could debug this issue?
Thanks in advance!
I found the solution - my virus scanner has an integrated software firewall that blocked incoming connections...
Try with higher ports maybe ? I got WS working fine on SamsungZ1 on Tizen:2.3:Mobile
https://twitter.com/RzrFreeFr/status/70135763074535014#tizen-gear2-websockets
Maybe I could try your code on Tizen:2.4:Mobile too ?
I'm creating a webapp that support offline mode using AppCache.
When I'm online, it connect fine. If the connection is dropped and regain, it reconnect correctly.
My problem is when I'm opening my webapp when disconnected and then a connect to the internet, Socket.IO doesn't connect. It just doesn't try to connect.
I analysed a little bit the code, and it seen that it need a first valid connection in order to try to reconnect. If the first connection fail, it will permanently fail.
Is there something I miss?
So what stops you to have a global variable isConnectionStartedOnce, initialize it on the first successful connection. And on re connection event if it is initiaziled - reconnect, otherwise connect from scratch.
I'm using beanstalkd to offload some work to other machines. The setup is a bit unusual, the server is on the internet (public ip) but the consumers are behind adsl lines on some peoples homes. So there is a linux server as client going out through a dynamic ip and connecting to the server to get a job. It's all PHP and I'm using pheanstalk library.
Everything runs smoothly for some time, but then the adsl changes the IP (every 24h hours the provider forces a disconnect-reconnect) the client just hangs, never to go out of "reserve".
I thought that putting a timeout on the reserve would help it, but it didn't. As it seems, the client issues a command and blocks, it never checks the timeout. It just issues a reserve-with-timeout (instead of a simple reserve) and it is the servers responsibility to return a TIME_OUT as the timeout occurs. The problem is, the connection is broken (but the TCP/IP doesn't know about that yet until any of the sides try to talk to the other side) and if the client blocked reading, it will never return.
The library seems to have support for some kind of timeouts locally (for example when trying to connect to server), but it does not seem to contemplate this scenario.
How could I detect the stale connection and force a reconnect? Is there some kind of keepalive on the protocol (and on the pheanstalk itself)?
Thanks!
You could try to close each connection right after the request is answered and reopen a new connection each time.
There is no close() function but you deleting the Pheanstaly Object with unset($pheanstalk) will close it.
This explanation is quite helpful:
Pheanstalk (PHP client for beanstalk) - how do connections work?
I haven't tried it yet, but I came up with the idea of connecting to the beanstalk server through an SSH tunnel. We can enable the ServerAliveCountMax and ServerAliveInterval options on the tunnel, so that a network or server failure will cause the tunnel to close. This should then cause the pheanstalk client to report an error.
Recently I meet a weird problem, sometimes the browser will need about 20seconds to establish connecting to the IIS web server
1. this cannot be repro each time, when successful access the site, the following connecting will be very fast. After restart Application pool and Web Site, the first time connect will be slow.<br>
2. When success gernerate connection success, after minutes, the establsh connection will getting slow again.<br>
3. this is not relate to authentication, both Windows Authentication and Anonmymous will have the same problem.<br>
4. Installed HTTPWatch on my client machine, it shows that 20 seconds is connecting time before wating when this problem happen.<br>
5. localhost cannot repro, each time establish connection is fast
From the log of IIS, then first request is get after
how to debug this? seems this is relate to the network, porxy, domain, is there some tool can help to diagnostic this problem, and can tell me what the server is doing during the time slot of establishing connection