I created simple webpage with a pubnub (3.4) subscription, about every 5 minutes I see an XHR request to pubnub from my Chrome console. Is this correct behavior? Thanks for any insight!
In doSubscribe
XHR finished loading: "https://ps3.pubnub.com/time/0". pubnub-3.4.min.js:11
XHR finished loading: "https://ps2.pubnub.com/time/0". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/0?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/13569794952114592?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
XHR finished loading: "https://ps1.pubnub.com/subscribe/demo/xxxxx/0/13569794952114592?uuid=fb81a2a0-3fdc-4be1-94b2-dd23ce0c4bcd". pubnub-3.4.min.js:11
Yes, this is expected as PubNub uses HTTP Long-Polling for communication between the client and server.
ANSWER: PubNub and Multiple XHR requests
These 5 minute responses you show are PINGS from PubNub Cloud. Yes this is expected and correct behavior. Read more below to learn about how PubNub streams data to your client like Google Chrome. Also see What are the Blank Messages my Application Keeps Receiving to learn a bit more. Continue reading for the specifics:
PubNub Socket Connections
PubNub JavaScript client for mobile and web browsers like Chrome (webkit) maintain a socket connection that will last for one hour and up to 24 hours depending on the network traffic. Connections are refreshed after 24 hours and will automatically reconnect with reliable data deliverability (Catch-up Missed Messages). This is because PubNub maintains a Cloud Queue for your clients which re-delivers any missed messages.
PubNub Dropped Connection Catch-up
PubNub uses Cloud Queues to maintain messages in-memory until the data has been delivered to your client device like Google Chrome. So if you drop your connection, you will still receive the data sent during the offline state and once the connection has been restored, you will receive your messages.
PubNub XHR Pings and Requests
In your Chrome Dev Console you will see pings every 300 seconds which is 5 minutes. These pings are an Application Layer transport protocol that ensures the data stream is still active and alive. This is helpful in states of internet loss and restoration. This allows better-than TCP-KeepAlive connectivity and improved reliability. During Data Transmission Cycle, the connection state is maintained as described in the previous section with connections laster up to 24 hours before they are recycled.
Related
This may be a very stupid question but I haven't been able to find a definitive answer online. I'm using the Masstransit Request/Response pattern with RabbitMQ as my message broker.
I have a request to add a user to a database and a consumer running in a separate service that consumes that request and sends a response.
The request has a ten second timeout. My question is: If that request timed out before the consumer was able to consume it, is the request removed or will it eventually get consumed by the consumer and the request client just times out and moves on?
The request client is for requests, which by default have a 30 second timeout (which you indicated you are changing to ten seconds). This setting applies to both the request client timeout (the point at which it stops waiting for a response) and the time-to-live of the message sent.
If you want to extend the message TimeToLive, you can change that value when sending the request using:
await client.GetResponse<T>(request, x =>
x.Execute(context => context.TimeToLive = TimeSpan.FromDays(10)));
TL;DR - yes, the request message will expire after 10 seconds and by automatically removed from the queue by the message broker.
We use the https://github.com/web-push-libs/web-push package. We divide all tokens into groups of 1000 and send web push by sending a post request to GCM for each token with foreach loop. The system is working smoothly for about two years. But the response timeles have been prolonged on the GCM side for about 1 month. As a result of the detailed debuging, the encryption (AuthToken and p256PH) and sending GCM request processes are completed in 3 seconds for all 1000 tokens. But their responces are coming late from GCM side. Therefore, the pushing time has increased and we are experiencing timeout problems.
Is there any kind of problem that you encountered and solved?
Here is my work flow for an app on iOS 8:
I open an UIWebView
Open a webpage
Server requires authentication.
I authenticate to the server using a client certificate stored in a p12 file.
I can access all the pages stored on the server with no problem (BTW, the site is single paged, and makes AJAX request to the server)
If I leave my app idle for 10 minutes, I can no longer make any request, and get this error message in the console
CFNetwork SSLHandshake failed (-9824 -> -9829)
NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9829)
Now, I understand this is because the TSL session expires after 10 minutes on the device and I have to open it again. How can I do that? I don't get any callbacks in my code.
Related to this issue is this article: https://developer.apple.com/library/mac/qa/qa1727/_index.html
I am working on a chat app using XMPP Protocol.
I tried following
this tutorial from github . Everything is working fine using
XMPP.
But I'm unable to receive offline messages when user comes
online.
As user A is logged out and user B sends messages to user A, and when user A logs into app, it must receive all the messages that
were sent by user B during offline session.
How can I receive these offline messages?
My app is totally stuck on this issue. Please help if anyone
knows the solution. Any help will be appreciated. Thanks
You need to enable mod_offline on server, if you are using ejabberd XMPP Server.
Here is the code needs to enable module:
ignore_pep_from_offline: true
max_user_offline_messages:
admin: 5000
all: 100
mod_offline:
access_max_user_messages: max_user_offline_messages
Write this code in ejabberd.yml config file.
It will store unto 100 messages per user received when client was offline.
At client side, you may have to register for service:
'http://jabber.org/protocol/disco#info'
If you done this, whenever offline client gets online, server will send those stored messages to respective client.
You've to send Request for offline message if server supports. XMPP works on TCP protocol so as soon as client is up, it should send request to server.
<iq type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://jabber.org/protocol/offline'/>
</iq>
MtGox Streaming API is down or is something wrong with the code?
I used this example https:// bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master
You can test here http://atc.leadsoft.eu/test.html
I entered the server url (https://socketio.mtgox.com/mtgox) and click connect, but most of the time it writes only Connected or Connection timeout and freezes.