03-19-2011 09:09 PM - edited 03-19-2011 09:11 PM
Working on an app that uses socket connections.
soc = (SocketConnectionEnhanced)Connector.open("socket:/
Go on to use a DataInputStream and DataOutputStream to communicate.
The server is working, can transmit fine with simulator as well as another curve (not same model) . (There is a slim chance that deviceside=true wasn't passed as a parameter when we tested on the other curve, so that would make it go through BES ?? It was probably still there though).
Imho, this means the only places the issue could exist are a) how the code is applied on the phone client or b) the phones or their settings (have 4 curve 8530s on the same CDMA network).
- These phones were just activated in the past few days, is there any chance something is missing from the service book to allow for socket connections? (I doubt this as I downloaded ping messenger which I assume uses sockets.. and all is fine).
Any application permission I need to set?
Out of ideas !! Please let your mind flow. Thank You!
Solved! Go to Solution.
03-20-2011 06:52 AM
Welcome to the forums.
I presume you have reviewed this:
and so are familiar with the various connection suffixes you can add and the effect they can have.
If you have BES connected devices, I recommend that you use BES connection (";deviceside=false"). If they are BES devices and the BlackBerry Browser works, then you should be able to talk using that connection suffix..
It is unlikely that there are Service Records missing - I won't look there first.
With regard to permissions, the phone will typically produce a prompt asking for this the first time your application attempts to connect. If this is denied, you application will get an Security Exception.
Review the above and hopefully it will help. If not, then can you debug the failing connection and tell us what Exception you are seeing from the BlackBerry side.
One final think, if you are using DataInputStream, be careful about using readFully - I think there are some issues with it. I would recommend that you just use InputStream and OutputStream if you can.
03-23-2011 09:42 PM - edited 03-23-2011 09:50 PM
For anyone who might find this thread after encountering the same problem:
The issue was with the DataInputStream ... available() was ALWAYS returning zero, even though there were more bytes to read. This was only on our 4 Curve 8530s testing phones. Tried it on another Curve and a Bold and they didn't have this issue.
Stopped using available() and tried a read for much larger than any of our packets will be (5000 bytes).
Have some test phones with 188.8.131.527 they wouldn't work with this.
After upgrading to 184.108.40.2060 they all work perfectly.
I read somewhere that the available() issue has to do with J2SE -> J2ME problems, something about a wrapper. This issue exists (or did exist) with TSL/SSL apparently (sorry I can't find the thread I'm getting this info from, if anyone really wants to see it reply and I'll grab the link from the history of my laptops browser).
Hope this helps someone!!