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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:15:19+00:00 2026-05-26T14:15:19+00:00

Is it possible to send and recieve a structure with SSL_write and SSL_read? Client

  • 0

Is it possible to send and recieve a structure with SSL_write and SSL_read?

Client

typedef struct{
      unsigned int userid;
      unsigned int name;        
} sendInfo;

  sendInfo infofile;



SSL_write(ssl, infofile, sizeof(struct infofile)); 

Server

bytes = SSL_read(ssl, struct(infofile), sizeof(struct infofile) );

Is there other methods to send a structure?

Cheers.

  • 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-26T14:15:20+00:00Added an answer on May 26, 2026 at 2:15 pm

    You should not do this in general. C data structures do not have a mandatory, universal memory layout that’s the same on all architectures and platforms. When you serialize data, you always have to break it down into individual parts (integers and byte sequences), and moreover you will have to specify the size and ordering (endianness) of all multibyte fields like integers.

    Imagine that you find a block of bytes on the street. How would you know what it means? When you serialize, you have to publish a specification of the format, something which you could apply to your found bytes and say, “this is the first integer”, “this is a sequence of bytes, counted by the previously read integer”, etc. With this information, the corresponding deserializing code can rebuild the internal data structure.

    A typical serialization field would be something like “unsigned 32-bit integer, little-endian”. That means you have to write out bytes n & 0xFF, (n >> 8) & 0xFF, (n >> 16) 0xFF, (n >> 24) & 0xFF, and you read back in buf[0] + (buf[1] << 8) + (buf[2] << 16) + (buf[3] << 24). Note that you’ll never have to know anything about your platform, but only about the wire format.

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

Sidebar

Related Questions

Is it possible to send an email from my Java application using a GMail
Is it possible to send messages from a PHP script to the console in
Is it possible to send a UDP broadcast packet to a different subnet through
Is it possible to send an Email with only cc or bcc recipients using
It is possible to send highlighted code directly to the F# interactive console in
Is it possible to send 100 Continue HTTP status code, and then later some
Is it possible to send pre-compressed files that are contained within an EARfile? More
I just wonder if it is possible to send Meeting Requests to people without
I was wondering if it is possible to send a Fax via ASP.NET without
Anyone know if it is easily possible to send **kwargs over PyAMF from NetConnection.call()

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.