Results 1 to 15 of 15

Thread: How does a QTcpServer process the data coming in? (Qt 4, SuSe10, gcc v4.0.2)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5

    Default How does a QTcpServer process the data coming in? (Qt 4, SuSe10, gcc v4.0.2)

    I have the following code in my app. All this works, i tested by telneting to the machine running the QTcpServer code on port 4567 and I get the "pending connection" message.

    How do I do the following:

    1. accept the connection.
    2. Read the data coming through that connection.

    Any help is appreciated. Thanks in advanced.

    Qt Code:
    1. void mythread::run()
    2. {
    3. tcpServ = new QTcpServer;
    4.  
    5. connect(tcpServ = SIGNAL(newConnection()), this, SLOT(processConnection)));
    6.  
    7. tcpServ->listen(QHostAddress::Any, 4567);
    8.  
    9. exec();
    10. }
    11.  
    12. void mythread::processConnection()
    13. {
    14. if(tcpServ->hasPendingConnections())
    15. qDebug("Pending connection received");
    16. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by freak; 11th May 2006 at 17:48.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.