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 8670615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:45:00+00:00 2026-06-12T18:45:00+00:00

I tried to flush a socket after calling to send function in c++. I

  • 0

I tried to flush a socket after calling to send function in c++.
I used winsock2.h library.

I need to send the data immediatly after the send message, but I can not find any function like flash function.

I am trying to send messages to a device and it expect receiving messages one by one.
I mean that if I sending two messages in the sender like “MessageOne” and “MessageTwo”, the receiver received “MessageOneMessageTwo” that is not seperate, and the device not recognize the commands.

So how can I do that?

  • 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-06-12T18:45:01+00:00Added an answer on June 12, 2026 at 6:45 pm

    There is nothing you can do on the send side to make the receive side receive messages ‘one by one’. Is entirely the receive side responsibility to properly reconstruct the sent frames (‘messages’). Receive code must know the message length somehow (entirely protocol specific) and receive as much data as appropriate to construct an entire frame (usually achieved by posting recv with a specified length and specified that is interested only on the entire buffer, eg. MSG_WAITALL flag). I find it very hard to believe your device does not know how to handle this, and if that’s indeed the case there is literally nothing you can do. I find it somehow more likely that you do not understand the device/protocol requirements and you’re asking the wrong question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a socket program to transfer data from one pc to another, but
How can I flush data from streambuf to file? I've tried read(*socket_, streamBuf, boost::asio::transfer_at_least(694784))
tried uncommenting pam_limits.so from the pam.d directory but no luck. Basic PAM seems to
Tried searching the site, but cannot find an answer to my problem: Lets say
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
Here's an extract of my code: OutputStream out = this.socket.getOutputStream(); out.write(fourBytes); out.write(someBytes); out.flush(); This
I am working on a Java application where I need to send an array
New to TCP socket communications in C#, having a problem where I send some
I wanted to know how to flush the socket streams while doing socket programming
I have a Socket that works well, but is it possible to write a

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.