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

  • Home
  • SEARCH
  • 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 7829147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:38:23+00:00 2026-06-02T10:38:23+00:00

asio::ip::address_v6 takes a bytes_type for a parameter, which is basically a boost::array in network-byte

  • 0

asio::ip::address_v6 takes a bytes_type for a parameter, which is basically a boost::array in network-byte order.

I have a RAW IPv6 address in a void * variable. What’s the quickest way to turn a void * into a asio::ip::address_v6? Preferably using the constructor.

  • 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-02T10:38:24+00:00Added an answer on June 2, 2026 at 10:38 am

    You can’t do better than initializing an asio::ip::address_v6::bytes_type, which can actually be a std::array or a boost::array:

    // We need an unsigned char* pointer to the IP address
    unsigned char *youraddr = reinterpret_cast<unsigned char*>(your_void_ptr);
    asio::ip::address_v6::bytes_type myaddr;
    // Copy the address into our array
    std::copy(youraddr, youraddr + myaddr.size(), myaddr.data());
    // Finally, initialize.
    asio::ip::address_v6 ipv6(myaddr);
    

    Note that it would be better to directly store a bytes_type instead of that void*, if you are able to modify that structure, obviously.

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

Sidebar

Related Questions

I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor
I have read the boost asio reference, gone through the tutorial and looked at
It seems boost::asio defines a separate endpoint class for each protocol, which is irritating
I am learning boost/asio and writing example program which was in e-book. of course
I have a project that uses Boost.Asio and the Media-Decoding-Samples that come with the
I'm writing server using boost.asio. I have read and write buffer for each connection
I use boost::asio as a network framework. As a read/write medium it uses boost::asio::streambuf
Boost asio has such socket connect api . I have such simple code: try
I am using boost::asio to make a socket network. The library has a number
I have a problem with a boost::asio::ip::tcp::iostream. I am trying to send about 20

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.