[Interest] Using QSslSocket as QTcpSocket

Jason H scorp1us at yahoo.com
Mon Nov 21 18:27:43 CET 2011


Sure. SSL sockets are tcp Sockets, save for the negotiation. If you don't want encryption, just don't call startServerEncription or the client version.

However, I would have to ask, why not just abstract it to be QTcpSocket*?

There is no overhead if you are encrypting.

In all my code, the only difference is if you are on a secure port, then you start the encryption. Also, you should have some way of reporting the SSL errors. 




________________________________
 From: Chaser <chaser.andrey at gmail.com>
To: interest at qt-project.org 
Sent: Monday, November 21, 2011 12:06 PM
Subject: [Interest] Using QSslSocket as QTcpSocket
 
Hi all! Can a QSslSocket to work as QTcpSocket at unencrypted
connenctions? I don't want inherit from QTcpSocket for unencrypted
connenctions and from QSslSocket for encrypted connenctions, and have
two classes with duplicated code, so is it possible to use QSslSocket
for both cases?
And what about overhead and perfomance?
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20111121/4a79fba3/attachment.html>


More information about the Interest mailing list