Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 95
Registered: ‎10-19-2010
My Device: Blackberry 8110
My Carrier: Generic
Accepted Solution

Keeping SSL connection opened

[ Edited ]

Hello,

 

I am working on an application that uses SSL to communicate with a server. For every request I make, I open the connection, make the request and then close the connection.

 

This is causing the application to be slow, as many connections need to be opened and closed and each connection will do an SSL handshake.

 

I was thinking about keeping the connection "alive", so I just open a connection and I make as many requests as I want before I close it.

 

My question is: Is this possible in Blackberry? Has anyone implemented it successfully in their application?

 

Thank you very much in advance

Regards

Developer
Posts: 16,839
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Keeping SSL connection opened

connections cannot be kept open for an indefinite time as the framework kills them after some time.
you can try, but i am unsure if it would help.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 95
Registered: ‎10-19-2010
My Device: Blackberry 8110
My Carrier: Generic

Re: Keeping SSL connection opened

Thanks for your quick reply Simon,

 

You said: "as the framework kills them after some time" --> What is the timeout for this?

 

Another question:

 

Could I recreate the connection after it gets killed by the framework? At least this way the performance would be better than in my current situation.

 

Thank you very much indeed

Regards

Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: Keeping SSL connection opened

Are you using http or socket level connections?

Developer
Posts: 152
Registered: ‎07-28-2011
My Device: Bold 9900
My Carrier: MTN

Re: Keeping SSL connection opened

Have you considered setting up a keepalive on the server?

Developer
Posts: 95
Registered: ‎10-19-2010
My Device: Blackberry 8110
My Carrier: Generic

Re: Keeping SSL connection opened

Hi Peter,

 

I'm using http level connection. That's why I'm asking. I know it's possible for socket level connection using "keepalive". But my question is: is it possible using http/https connections?

 

Thanks so much

Regards

Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: Keeping SSL connection opened

To answer questions from previously:

 

"What is the timeout for this?"

2 minutes

 

"Could I recreate the connection after it gets killed by the framework?"

I am not aware of a way.

 

Because http is effectively a connect, send, response, close connection protocol, I don't believe there is anything that you do about this process - perhaps try to do more on each http request?

 

But this is not an area of great expertise, so I would wait for other input. 

Developer
Posts: 152
Registered: ‎07-28-2011
My Device: Bold 9900
My Carrier: MTN

Re: Keeping SSL connection opened

You can create a timer task and schedule a poll time of less than 2 minutes (according to peter's timeout information)

 

This can act as a "keepalive" if setup correctly.