[Qt-interest] Transferring a QPixmap through QTcpSocket

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri Apr 8 09:21:10 CEST 2011


On Thu, Apr 7, 2011 at 7:24 PM, Andre Somers <andre at familiesomers.nl> wrote:
> Op Do, 7 april, 2011 3:28 pm, schreef Thiago Macieira:
>
>> Given that the OP was closing the socket just after writing the pixmap
>> data,
>> then sending the length in advance is unnecessary. Conclusion:
>
> Is it? If you use that, wouldn't you need to check on the receiving end
> that it was actually the user closing the socket, an not the network
> connection failing or something like that?
>
> /me is trying to learn something here...

I think this signal would tell us if the connection was closed cleanly or not:

http://doc.qt.nokia.com/latest/qabstractsocket.html#error-2

Based on whether this signal was emitted or not we can decide whether
the data is complete.

-mandeep


>
> André
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list