Results 1 to 8 of 8

Thread: how can i send QStringList index by index

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2021
    Posts
    4
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how can i send QStringList index by index

    actually i have a text file.client must send line by line of file to server and server must process line by line of data but client packet many of line and then send to server.
    as result server recive many of line and wrong process .
    this is my problem i hope you understand .thanks to you

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how can i send QStringList index by index

    Then split your received stream... tcp is a stream - no matter what you want or think. When you want a protocol you have to implement it by your own.

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

    Validimir_verekno (22nd June 2021)

  4. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how can i send QStringList index by index

    Quote Originally Posted by Validimir_verekno View Post
    actually i have a text file.client must send line by line of file to server and server must process line by line of data but client packet many of line and then send to server.
    as result server recive many of line and wrong process .
    How does the client (sender) know when the server (receiver) is done processing the last line it received? This is the protocol that Christian Ehrlicher is talking about.

    The client is essentially a state machine that switches between:
    1. Send a line
    2. Wait for signal of completion from server (receive) then go to 1.

  5. #4
    Join Date
    Jun 2021
    Posts
    4
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how can i send QStringList index by index

    SOLVED
    thanks to "ChrisW67" & "ChristianEhrlicher"
    i find QStreamData : D
    QStreamData qsd(socket);
    qsd<<File.readLine();

Similar Threads

  1. Replies: 1
    Last Post: 4th February 2021, 10:58
  2. QNetworkinterface index
    By fruzzo in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2015, 10:26
  3. qstringlist index out of range at declaration!
    By fatecasino in forum Newbie
    Replies: 4
    Last Post: 30th April 2015, 16:33
  4. Readline from a particular index
    By giusepped in forum Qt Programming
    Replies: 5
    Last Post: 30th April 2010, 20:58
  5. Get Row Index
    By wirasto in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2009, 13:57

Tags for this Thread

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.