Results 1 to 9 of 9

Thread: QTcpSocket and QProgressBar/QProgressDialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTcpSocket and QProgressBar/QProgressDialog

    Quote Originally Posted by nikkadim View Post
    Do you have link to some code example for this?
    No, I don't have link to any example code If you want an efficient protocol, it has to depend on what you are currently doing.

    The most trivial (but probably not a very clever) approach would be to simply memcpy() your structure to the socket and then do the same on the other end.

    PS: Now I have receiving speed about 20 Mbit/s, at 1Gbit/s NIC. Test was performed on one machine.
    I don't see how that's relevant to anything. Especially if you are sending to localhost which doesn't even use your network interface card.

    Either you have efficiency or ease of use. Choose which is more important for you.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2

    Default Re: QTcpSocket and QProgressBar/QProgressDialog

    Looks like you recommend me don't use QT at all

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTcpSocket and QProgressBar/QProgressDialog

    No, I recommend you to use tools and mechanisms proper to the problem you are facing. I understand you took the code from some Qt example (e.g. fortune cookie) but this is very generic (and badly written) code that is not suited for problems more complex than reading a couple of bytes from the socket. If you know what structure of data you expect, then you really don't need to send the size of that structure to the socket and you don't need to go through generic serialization code that sometimes bloats the data sent unnecessarily (and obscures access to the data from non-Qt applications).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QTreeWidget and QProgressDialog?
    By progman in forum Newbie
    Replies: 6
    Last Post: 18th March 2010, 18:05
  2. How to execute a QProgressDialog once
    By franco.amato in forum Newbie
    Replies: 4
    Last Post: 16th March 2010, 16:36
  3. Need help in QProgressDialog
    By santhoshv84 in forum Qt Programming
    Replies: 3
    Last Post: 12th September 2008, 18:24
  4. QProgressDialog
    By samirg in forum Qt Programming
    Replies: 5
    Last Post: 5th September 2007, 16:37
  5. qprogressDialog
    By mickey in forum Qt Programming
    Replies: 5
    Last Post: 17th July 2006, 14:16

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.