[Interest] QTcpServer. Connecting.Sending data.

Alexander Syvak alexander.svk at gmail.com
Wed Oct 9 20:10:32 CEST 2013


here's the code of the redefined method run() of QThread class =>
void run() override


        srv = new (std::nothrow) tcp_server(ised_win_raw_ptr);

#ifdef DEBUG

        qDebug() << "listener's thread => " << thread();


        terminate_ = false;

        while ( !terminate_ ) if ( !srv->isListening() )
srv->listen(QHostAddress::Any, port);

#ifdef DEBUG

        qDebug() << "Deleting the ised_tcp_server object.";


        srv->close(); // Closes the server. The server will no longer
listen for incoming connections.

        delete srv;


The program connects to 9000 port for listening.

Using the netcat command
nc -vv 9000


PC_NAME [] 9000 (?) open

Then I typed start and hit Enter.

The break point has been set in incomingConnection which is redefined
in the tcp_server class inheriting QTcpServer.
Debugger did not paused in the method body when netcat connected to the port.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131009/e04449a4/attachment.html>

More information about the Interest mailing list