Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:10:38+00:00 2026-05-31T15:10:38+00:00

I am trying to send 2 request one by one at same time. My

  • 0

I am trying to send 2 request one by one at same time. My code is following (this is example code):

QTcpSocket client;
...
client->write(block);
client->write(block);

Problem is following. Server receives only first request. There is no second request. I sniffed using wireshark and see that there is no second request in tcp packets.

What must i do to send many requests via QTcpSocket one by one?

UPD: I inserted qDebug() << this->bytesAvailable() << "bytes"; to server in readyRead() and qDebug() << this->bytesToWrite(); after each client->write(block); in client. Also, I added this to client:

connect(this, SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWritten(qint64)));

void Connection::bytesWritten(qint64 count)
{
    qDebug() << count << "bytes written";
}

I send ORDER_STATUS_GET_LIST constant in first request and ORDER_GET_LIST in second. I added data output in server. I received first command.

There is output listing:

Client:

Sending ORDER_STATUS_GET_LIST 
11 bytes to write 
Sending ORDER_GET_LIST 
68 bytes to write
68 bytes written

Server:

68 bytes 
ORDER_STATUS_GET_LIST received
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:10:39+00:00Added an answer on May 31, 2026 at 3:10 pm

    According to the documentation, you need to flush() the socket IF you don’t return to the event loop between multiple writes.

    The proper solution would be to buffer your blocks into, e.g., a QByteArray and send the buffer at once.

    QTcpSocket client;
    QByteArray buffer;
    ...
    buffer << block;
    buffer << block;
    client->write(buffer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send a SOAP request using SOAPpy as the client. I've found
I have a problem when trying to send a POST request. The sending method
This might seem like a strange problem, but I am trying to send as
I'm trying to send an attachment to client from Axis2 web service. The problem
I'm working on a project where I'm trying to send request to our webservice
I wrote REST service using ASP.NET Web API. I'm trying to send HttpDelete request,
I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating . Can't get it
I'm trying to send a http get request in a php file to a
I am trying to send a json RPC ajax request when the page is
Trying to find a way to send a POST HTTPS request from Python to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.