[Development] QTcpSocket, QLocalSocket, common-use-model?

Thiago Macieira thiago.macieira at intel.com
Tue Oct 9 16:59:15 CEST 2012


On terça-feira, 9 de outubro de 2012 14.42.32, Knoll Lars wrote:
> > What you're asking for is an intermediate base between QAbstractSocket
> > and 
> > QIODevice, but I'm not sure how much it's worth. What methods from 
> > QAbstractSocket do you need which are also common (same signature)
> > between 
> > that and QLocalSocket?
> 
> And why would one need polymorphism here? If the methods are named the same
> and behave the same, it's a matter of changing the class name to move from
> local to TCP or back.

That's my point: I don't see the need for polymorphism beyond QIODevice. Code 
that deals with multiple socket types will need to use QIODevice and, by doing 
that, it will also be able to deal with QProcess, QFile, QBuffer, etc.

The only alternative would be to have a generic socket class, like what I 
designed for KDE in 2003 (KStreamSocket), which took a generic string as 
address and worked with both TCP and Unix sockets. Even if we decide that's a 
good design, we can't implement it now in Qt 5.

-- 
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/20121009/203178db/attachment.sig>


More information about the Development mailing list