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

Native Development

Reply
Highlighted
New Contributor
Posts: 6
Registered: ‎04-26-2013
My Device: Playbook, bold 9900
My Carrier: Three

bps_remove_fd failure when trying to store a QSslSocket inside a QScopedPointer (Playbook, Qt 4.8.3)

[ Edited ]

Hi,

 

I am storing a QAbstractSocket in a QScopedPointer as follows:

 

QScopedPointer<QAbstractSocket> nntp;

 

In my implementation, I store either a QSslSocket or a QTcpSocket (both of which inherit from QAbstractSocket) depending on whether the conenction is to be encrypted, i.e.,

 

if(ssl) {

   nntp.reset(new QSslSocket(this));

   (dynamic_cast<QSslSocket*>(nntp.data())))->connectToHostEncrypted(server, port);

} else {

   nntp.reset(new QTcpSocket(this));

   nntp->connectToHost(server, port);

}

 

When going down the ssl route (non-ssl works fine!), I end up with the following run time error:

 

virtual void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier*) bps_remove_fd() failed 19

 

The error is probably blackberry related as the code works as expected on other platforms (tested on mac and linux). (Note, the number 19 refers to the file descriptor).

 

Any ideas why I am seeing this error and how I can fix it?

Thanks,

Ben.

 

 

New Contributor
Posts: 6
Registered: ‎04-26-2013
My Device: Playbook, bold 9900
My Carrier: Three

Re: bps_remove_fd failure when trying to store a QSslSocket inside a QScopedPointer (Playbook, Qt 4.8.3)

Don't knoe why the hell I did this. A QSslSocket is a QTcpSocket so I don't even need to store a QAbstractPointer in a QScopedPointer and then have the casting thing. I can simply just use a QSslSocket and use it in either encrypted or non-encrypted mode.