[Development] Common base class for all socket types

Thiago Macieira thiago.macieira at intel.com
Thu Nov 8 17:30:40 CET 2012


On quinta-feira, 8 de novembro de 2012 15.48.29, shane.kearns at accenture.com 
wrote:
> I think most of the issues can be solved by connecting the socket first,
> then using QIODevice as your base class pointer. When you call
> QIODevice::close() that will disconnect the socket.

QNAM proves that it is possible. The put() and post() methods taking a 
QIODevice pointer operate on any class deriving from QIODevice. The 
QNetworkReply test tests QFile, QBuffer, QTcpSocket, QSslSocket, QProcess and 
QNetworkReply itself.

The only thing is that it requires two implementations: the random-access one 
(QFile, QBuffer) and the sequential one (all the rest).

> I'd like to see non blocking (or asynchronous) IO for files as well.

Would be interesting.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121108/a007508c/attachment.sig>


More information about the Development mailing list