Results 1 to 9 of 9

Thread: problem with QTcpSocket

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    2
    Platforms
    Unix/X11 Windows

    Default Re: problem with QTcpSocket

    Hi,
    I'm not sure. I read a Qt book, and there I read I have to write the lenght of my message first
    in my tcp package as a qint64.
    I took the code out of the book and chance a few things.
    In real I only want to send the string as I write it in the QString. -> exactly this String
    I thought to write the lenght before the message is something I have to do because of tcp.
    Greetings,
    SuperSonik
    Last edited by SuperSonik; 31st January 2007 at 10:11.

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

    Default Re: problem with QTcpSocket

    Take a look at the docs, you'll notice the write() method that takes a byte array as its argument (it's probably defined in QIODevice class).

  3. The following user says thank you to wysota for this useful post:

    SuperSonik (31st January 2007)

  4. #3
    Join Date
    Jan 2007
    Posts
    7
    Thanks
    2
    Platforms
    Unix/X11 Windows

    Default Re: problem with QTcpSocket

    Ok,
    I have found my problem. I think my programm is working for a while.
    The error message was wrong. If I call tcpsocket.errorString() and there is no error the funktion returns "Unknown error".
    Now it's working. Thank you to all.
    Greetings,
    SuperSonik

Similar Threads

  1. Problem with QTcpSocket and QDataStream
    By Valheru in forum Qt Programming
    Replies: 4
    Last Post: 16th September 2006, 13:08
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  3. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. QTcpSocket disconnection problem
    By erdi in forum Qt Programming
    Replies: 4
    Last Post: 19th February 2006, 21:50

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.