QTcpSocket: crash on write
Hi everybody,
I'm sometimes experiencing crashes on this function: qint64 QIODevice::write ( const QByteArray & byteArray );
I am just using QTcpSocket and I am also checking that the QTcpSocket instance has the connected status before writing.
I am not calling the flush method.
Edit:
I'm using this socket in two threads, one receives data from a server, the other sends data to this server.
Cheers!
Re: QTcpSocket: crash on write
Quote:
Originally Posted by
valerianst
I'm using this socket in two threads, one receives data from a server, the other sends data to this server.
This is most likely the problem, just don' do that.
Cheers,
_
Re: QTcpSocket: crash on write
thanks for your suggestion.
Are the write and QTcpSocket methods in general safe?
Added after 6 minutes:
Just answered by myself. QObject is not thread safe so I guess QTcpSocket isn't either.
I would like to avoid using mutexes in this case but I guess I have to