On the client side, when a new connection arises, I try to create a smart socket pointer to add it to QMap and continue working with them.
QSslSocket *client = dynamic_cast<QSslSocket*>(nextPendingConnection()); Q_ASSERT(client); client->setProperty("type", QString("CLIENT")); std::shared_ptr<QSslSocket> sock = std::make_shared<QSslSocket>(client); ... But now sock-> property ("type"). ToString () returns an empty string, and also we cannot write anything to the socket, since it is closed.
If you work with the client, then everything is fine, including in the context of other slots.
Tried with QSharedPointer, the same picture
QSharedPointer<QSslSocket> sck = QSharedPointer<QSslSocket>::create(client); Explain this behavior. Debian, gcc 4.7.2
UPD Hmm, and if you transfer to QMap just SharedPointer (client), it works ...