BlackBerry Connection issue : Cannot open any more tunnels - blackberry

I get this error when i try to authenticate via OAuth, i am able to use the connection factory to access unauthenticated requests. It works fine on the simulator but doesnt work on the device. It worked once or twice on the device but fails consistently every other time.
I have tried manually setting the APN on the phone but still unable to connect, while other requests successfully execute.

I am using the Connection Framework from BB OS5 and higher, so the connection was not the problem. The GET and POST requests worked well over the simulator but the POST request failed on the phone, while the GET request worked on the phone. The problem was a simple error in the POST request, i set the content length to just account for the URL instead of also the data being sent. I simply removed the content length in the POST URL and all was ok.

Related

GCM replies success to server, device not getting message

I am developing a sample app for iPhone to receive GCM messages. It registers successfully, getting a registration token. Using this token I submit a message to GCM server with it replying success. This has no visible effect on the phone or in the app.
This is true if phone is on, access code entered, both with app running or not running.
What I already checked/tried:
SenderID, registration token, server auth key are correct. Also tried to reinstall app to get new registration token, problem persists.
Put trace logs into all callback functions, the ones about registration are called how I expect them to be called, the ones about receiving messages are silent.
Tried it on wifi and GSM network too, same.
Attempted to find a solution here on stackoverflow.
I couldn't check but I am quite confident that there are no ports blocked on wifi.
What can possibly be wrong? Any ideas what else I am to check?

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.

iPhone network requests are not working sometimes

In my app I'm using MKNetworkKit to make requests to my server and also make direct calls to Facebook using Facebook SDK. Sometimes (once in a few days) I get an odd issue: all network requests from my app stop working (both to my server and Facebook). I can't figure out what steps exactly cause this. When I have the issue I check other apps / Safari from my phone and internet connection is OK. If I close my app, wait for a couple of minutes and open it again then everything goes back to normal. I'm using WiFi for testing. What can cause this?
It seems to be exactly like in this question: iPhone app gets into a state where network requests never complete , although I don't use MonoTouch.
UPDATE:
I do receive callbacks from MKNetworkKit saying "Request timeout" (I have 10 seconds request timeout in MKNetworkKit settings). And I don't receive callbacks from Facebook.

Blackberry http post request length trouble

I have a blackberry program that sends data using http post requests to a backend. Now the code works perfectly on my simulators (OS 5/6/7) and even on real devices, but on some other devices in some countries, the connection fails when using 3g with http error code 400 (Bad Request) but over WiFi it's ok.. After investigating, i realised that those telecom operators' bis-b proxies were "blocking"/"rejecting" the post request because of the size (>7kb). The problem is i can't shorten the request size, so any ideas on how to go about this? Any would be highly appreciated. Thanks
EDIT
This is the connection string used when connecting through the BIS.
deviceside=false;connectionUID=GPMDSXXXX;ConnectionType=mds-public (XXXX varies from network to network)
On further inspection, I realised that the "working" connections use the BIS_B TransportDescriptor type (5) to connect whereas the "failing" connections are using TCP_CELLULAR (1) to connect.
i.e. calling connectionDescriptor.getTransportDescriptor().getTransportType() for the working connections gives 5 and for the failing ones gives 1. Any ideas why this could be happening?
Try to use HTTPS. In this case carrier can't sniff what exactly is going inside.

getting IOException : Peer refused the connection (BlackBerry)

Can anyone tell me why i am getting this IOException:smileytongue:eer refused the connection??? I was testing my application yesterday it was working fine..but today when i opened it i cannot log int my application...i cannot login from the simulator.
.i hve tried appending ";deviceside=true" , ";deviceside=false" and removing it from the url..but nothing seems to work even on simulator...Iwas able to login until yesterday...no change in the code has been made...
The login url is Https url..but i dont think that may be the issue since i was able to access it till yesterdey...
Can any one help..??
I'd double check that the server you are talking to is still up (can you connect to it from a browser on your computer?) and also ensure that the Windows Firewall is not blocking traffic from the simulator. Also, unless you're just using Direct TCP and/or Wi-Fi, make sure that MDS simulator is up and running BEFORE you launch the simulator.

Resources