c++ Sending struct over network
问题 I'm working with Intel SGX which has predefined structures. I need to send these structures over a network connection which is operated by using boost::asio . The structure that needs to be send has the following format: typedef struct _ra_samp_request_header_t{ uint8_t type; /* set to one of ra_msg_type_t*/ uint32_t size; /*size of request body*/ uint8_t align[3]; uint8_t body[]; } ra_samp_request_header_t; For the sending and receiving, the methods async_write and async_async_read_some are