Socket.io takes more time in receiving message from Node server - blackberry

I am using socket.io to connect to a server using Blackberry os7 (BB curve) mobile. Message emit is working fine. But it is not receiving message at the right time. It takes up to 10 seconds. Sometimes works fast , sometimes very slow.
The same code is working fine in Blackberry 10 mobile. I am developing the application using Blackberry webworks(HTML5).

Related

iPhone sending Encrypted Alert packet

Background: I have created a hybrid app in angular using the capacitor library. Everything is working well for the browser and the android mobile app and the iOS mobile app. On the backend, we are using hardware that is acting as a server. The hardware and our mobile are connected to the same router and we are accessing the hardware using an IP address. Also, we have added a self-signed certificate on the hardware and are using HTTPS while communicating with the hardware.
Bug: The only issue we are facing right now with the iOS app is its slowness. I did some digging around the frontend using Wireshark and came to a point where the iOS app is sending the acknowledgment packet followed by an encrypted alert packet when it receives a response from the server. This is happening for every request. After further debugging on the server end I came to know that once it receives an encrypted alert it is closing the socket. Then again it is performing session handshake, opening the socket again and then processing the request. So, basically, the below process is repeated every time:
Performing session handshake
Opening Socket
Processing request
Sending response
Closing the Socket
On the contrary, on an android device, this process is only happening the first time it sends the request and then data transmission is taking place without closing the socket.
Below are the screenshots of Wireshark for Android and iOS:
iOS Screenshot:
Android Screenshot:

A single case of Safari on iOS9 not connecting to websocket

I have an issue with a single (at least for now) iPhone not being able to connect to websockets. Unfortunately I don't have access to the device and I can't run more tests on it at the moment, so no proper network dumps or anything else deeper level debugging available. Can't test on other network connections either at the moment.
Everything works perfectly with Chrome 45, Firefox 40, Chrome 45 on Android (many devices), Safari on iOS9 (device A), Safari on iOS8 (device B) etc. No errors, no cutoffs, nothing. Just works.
My websocket server runs on IIS 8.5 / ASP.NET, created as an API controller with the typical way (PullHandler is an async Task whileing until connection closes)
if (HttpContext.Current.IsWebSocketRequest)
{
HttpContext.Current.AcceptWebSocketRequest(PullHandler);
return Request.CreateResponse(HttpStatusCode.SwitchingProtocols);
}
else
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad request");
This should not cause any issues, especially this one. The client side JavaScript is also the simple
new WebSocket("ws://" + window.location.host + "/api/Some/Endpoint);
I am using plain HTTP, no SSL/TLS.
When trying on iPhone device X with iOS9 (13A344, not entirely sure of which model) it just can't get the connection. I am also using SignalR which automatically goes into longPolling transport on this device. With others it's nicely on webSockets transport.
Quick testing on UK Orange 3G connection showed on my HTTP logs that for some reason the request for my endpoint has gone to the else branch, like something had stripped the upgrade headers away.
GET /api/Some/Endpoint 80 - Mozilla/5.0+(iPhone;+CPU+iPhone+OS+9_0+like+Mac+OS+X)+AppleWebKit/601.1.46+(KHTML,+like+Gecko)+Version/9.0+Mobile/13A344+Safari/601.1 - 400
Status 400 is clearly showing the bad request that my code is sending if the request is not a proper websocket request. I don't know if there could be some transparent proxy, that could explain this. The 400 response was received without any delays.
But this was a problem also through wifi on the same device. Again, a laptop with OS X and Safari had no issues on the same wifi to connect to SignalR and my websocket server. Only the iPhone had issues. On wifi I didn't get any attempts to connect on the logs and SignalR also immediately went into longPolling transport. The wifi apparently used Virgin Media's network based on IP address.
On wifi there is first an open event. Then after some time there is a close event with status 1006, which is abnormal termination without a close packet. My code tries to connect again and the same happens. Strangely there is no log entry at the web server, but it might just be Safari's way to post the open event even though an actual connection was not established and after a timeout it sends the close event.
The device should not have any proxies set up and other browsing works without issues. Unfortunately I couldn't get any information about any other site that would use websockets working or not on that device.
Has anyone run into this kind of situation? I do understand that the 3G might just be a misbehaving proxy, but the wifi issue cannot be explained with that.
Just want to expand the universe for this issue.
I Have an app that runs great in simulator. App has both http Jason IO and web socket IO.
Now that I can target my iPhone and not the simulator. App on iPhone successfully does the http Json stuff but not the web socket stuff.
While I am not using safari and js my symptoms are very similar to yours. I am using Xcode 7 to generate code that targets to iPhone 5 using iOS 9.0.

Phonegap iOS app performance is very poor while AJAX Request is frequently use

I am developing phonegap application in iOS using cordova3.5.0. In my application I want to update data every minute. I am using Ajax request for that. Every minute, Ajax request is initiated and response is coming from server.
I have observed that performance of the application is very poor on iPhone 5s iOS 8 (new device) and as well as on iPhone 4 iOS 7 (older device).
I cannot figure out any reason why the application performance is so poor on the newer device also. I have observed that when Ajax request is initiated, then the response from the server is delayed for 30 seconds. I cannot figure out that why response is delayed. Is it due to Phonegap environment or else?
I have also observed this in browser, server response is very fast and in core android application is also the server response is very fast. If anyone can guide me then it will be very helpful to me.
Thanks.

Signalr - Long message delay

I have developed a chat application using signalr and asp.net mvc. When a user sends a long message (100 - 200 characters), it will take some time to transfer. This happens from both the ends - client and server and when the application is running on the online server, but this won't happen when the application is running on a local server.
My question is how can we solve this delay problem in signalr so that messages can be sent frequently without delay?

iOS XMPP client disconnects after some time

Am using open fire server and iOS xmpp client with Robbie Hanson's framework. My clients runs fine in background, as i have set the voip flag and everything. But after few hours around 15-20, it automatically gets disconnected. Am not sure why it's happening and why it is taking such long duration. I am not sending any messages or receiving any. The ping interval is 360 secs to which my client responds with an error, which is acceptable form of response to remain connected to the server. Anyone got the same issue ?
Openfire server: 3.8.1
iOS version: 6.1.2
Did you try using the setting "Do Not disconnect clients that are idle" available in Server Settings> Client Connections in Openfire server?

Resources