Results 1 to 2 of 2

Thread: Qt4.1, TCP-server, Ethernet, Windows

  1. #1
    Join Date
    Nov 2019
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt4.1, TCP-server, Ethernet, Windows

    My code gives me packets loss:
    Qt Code:
    1. clientConnection = new QTcpSocket(this);
    2. tcpServer = new QTcpServer();
    3. connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnect()));
    4.  
    5. void frmMain::newConnect()
    6. {
    7. clientConnection = tcpServer->nextPendingConnection();
    8.  
    9. connect(clientConnection, SIGNAL(readyRead()),
    10. this, SLOT(receivePkg()));
    11.  
    12. connect(clientConnection, SIGNAL(disconnected()),
    13. clientConnection, SLOT(deleteLater()));
    14. }
    15.  
    16. void frmMain::receivePkg()
    17. {
    18. read_size = clientConnection->read(buf_c, READ_BUF_SIZE);
    To copy to clipboard, switch view to plain text mode 

    Tell me how to create TCP-server:

    -received 10+ packets (1 packet length = 200+ bytes) per 1 ms
    -received packets for 10+ min
    -without packets loss

    May be I have to use another thread and set priority to thread.

    Give me server code, please.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt4.1, TCP-server, Ethernet, Windows

    Give me server code, please.
    Maybe you could try this instead of asking us to cook and serve your dinner to you.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Sending serial data over ethernet
    By awpitt13 in forum Newbie
    Replies: 2
    Last Post: 27th February 2017, 14:06
  2. Replies: 1
    Last Post: 15th October 2014, 22:00
  3. Qt Embedded on Pandaboard with ethernet
    By mathewjmanavalan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th June 2012, 06:24
  4. Need suggestion regarding TCP/IP and Ethernet
    By sudheer168 in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2009, 09:07
  5. Problem regading Ethernet uning TCP/IP
    By sudheer168 in forum Qt Programming
    Replies: 5
    Last Post: 9th March 2009, 19:29

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.