Results 1 to 2 of 2

Thread: My QtcpServer lost message

  1. #1
    Join Date
    Mar 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default My QtcpServer lost message

    I am deveropping TCPIP communication program.
    My project send messege from one client to server.
    But my project fail to receive same message.when It send with a short span.
    If it send with a log span.It can receive all message.
    Please tell me how to solve this probrem. 

    To deverop it, I refer to fortune client server example.
    My projects(both client and server) have MainWindow.
    so I use it to connect QtcpSocket and Qtcpserver. is it bad?
    Please tell me how to solve it.

  2. #2
    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: My QtcpServer lost message

    You are falsely assuming that if you send two blocks of data then the receiver will receive the data as two blocks containing one message each. TCP has no concept of messages, it treats data as an opaque stream of octets. The receiver can receive all messages in one segment or each message can be divided into several segments. You should buffer all incoming data and analyze the buffer looking for message boundaries based on the application protocol you implemented on the sender side.
    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. [QTcpServer] Lost Connection
    By Markus_AC in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2012, 12:08
  2. Replies: 4
    Last Post: 30th November 2010, 21:09
  3. Lost message sound
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2010, 17:36
  4. Replies: 4
    Last Post: 12th October 2008, 13:47
  5. Replies: 1
    Last Post: 18th June 2006, 10:12

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.