Is there any hidden problem with this code, please? I'w worried about living time of dynamic created "*connection" pointer.
Qt Code:
  1. void TMyTCPSrv::incomingConnection(int sockDesc)
  2. {
  3. TConnection *connection = new TConnection(this);
  4. connection->setSocketDescriptor(sockDesc);
  5.  
  6. // Send read message to this
  7. connect(connection, SIGNAL(toLocalServer(const QString&)),
  8. this, SLOT(onReadFromClient(const QString&)), Qt::QueuedConnection);
  9. }
  10.  
  11. class TConnection: public QTcpSocket
  12. {
  13. ...
  14. };
To copy to clipboard, switch view to plain text mode