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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:20:53+00:00 2026-05-26T01:20:53+00:00

How can I pass an XML output result / other object types in C++

  • 0

How can I pass an XML output result / other object types in C++ through sockets, and make sure that the data are not corrupted? The output size can be something between 100KB – 2MB in size. The UNIX sys/socket library would only allow me to send basic data types (like character string) as the socket message.

I know that Boost AISO library is also a good library for socket programming but I am not sure if it will allow me to send XML output / object types through sockets. Speed/performance is a major concern, and my server intends to have multiple clients connected to it. Any ideas / concerns on how to handle this? Do you have some existing example codes that does the same thing: sending object data type through C++ sockets? Could you please explain the approach that you did? Some example codes / pseudocode would be really helpful indeed.

  • 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-26T01:20:53+00:00Added an answer on May 26, 2026 at 1:20 am

    If you want check that the received data is correct, you should use CRC or other error detection codings. However sockets try to guarantee it and you can feel free to check the data again. Also in network transmission, Speed and Reliability are tradeoff, you should take something between them depending on your application.

    Second, for send data objects, What do you need is Marshaling or Serialization. You can marshal data objects before sending it, and create data object when receiving it in other side. You can do it yourself with your protcols or you can use ready libraries.

    A practice that marshals data object to XML is this. (Note: I didn’t test it myself)

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

Sidebar

Related Questions

I need to pass LOW-VALUES(am not very sure what kind would that be), as
I'm trying to generate XML that will output the structure and data of any
You can pass a function pointer, function object (or boost lambda) to std::sort to
I know you can pass arguments through the RunWorkerAsync function call when you first
I know that I can pass a string as the second parameter to the
Is there any way that I can pass arguments in selector? example: I have
I know from here that I can pass an ignore option in the jQuery.validate
I have been having a small problem that I can't by-pass it, I keep
I have the below xml <ResultCollection> <Result Id=551550 Pass=23 Fail=0 Owner=Dong/> <Result Id=551565 Pass=4
I have a xml code that can ahve two forms : Form 1 <?xml

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.