title: invalid argument on boost asio udp socket connect (IPv6)
body: <p>I'm struggling with an issue for hours:
  I want to connect an boost asio udo socket to an endpoint. There is no problem doing this in IPv4. But if I try to do the same in IPv6, I get an error-code "invalid argument".</p>
  
  <pre><code>using boost::asio::ip::udp;
  
  struct UdpConnectionParams
  {
      udp::endpoint m_localEndpoint;
      udp::endpoint m_remoteEndpoint;
  }
  
  boost::system::error_code setupUdpConnection(udp::socket&amp; p_socket, const UdpConnectionParams&amp; p_params)
  {
      // close socket
      boost::system::error_code h_ignoreError;
      p_socket.close(h_ignoreError);
      // variables for kind of UDP connection
      udp h_protocol(udp::v4());
      bool h_shallBind{false};
      bool h_shallConnect{false};
  
      // determine kind of connection
      if(p_params.m_localEndpoint != udp::endpoint())
      {
          h_protocol = p_params.m_localEndpoint.protocol();
          h_shallBind = true;
      }
      if(p_params.m_remoteEndpoint != udp::endpoint())
      {
          h_protocol = p_params.m_remoteEndpoint.protocol();
          h_shallConnect = true;
      }
      if(!h_shallBind &amp;&amp; !h_shallConnect)
      {
          // no endpoint specified, return error
          return boost::system::error_code(ENetworkErrorCode::NO_ENDPOINT_SPECIFIED, NetworkErrorCategory::getCategory());
      }
  
      try
      {
          p_socket.open(h_protocol);
          //bind socket to certain endpoint
          if(h_shallBind)
          {
              p_socket.bind(p_params.m_localEndpoint);
          }
          //connect socket to client. Thus it is possible to use p_socket.send()
          if(h_shallConnect)
          {
              p_socket.connect(p_params.m_remoteEndpoint);
          }
      }
      catch (boost::system::system_error&amp; h_error)
      {
          p_socket.close(h_ignoreError);
          return h_error.code();
      }
      // no error
      return boost::system::error_code();
  }
  
  int main()
  {
      boost::asio::io_service service;
      udp::socket socket(service);
      boost::system::error_code error;
      UdpConnectionParams params;
      params.m_localEndpoint = udp::endpoint(udp::v6(), 55555);
      params.m_remoteEndpoint = udp::endpoint(boost::asio::ip::address_v6::from_string("ff01::101"), 55555);
      error = setupUdpConnection(socket, params);
      cout &lt;&lt; error &lt;&lt; error.message() &lt;&lt; endl; // "invalid argument"
      return 0;
  }
  </code></pre>
  
  <p>The only way I get no error, is with localhost IP address (::1). There is no difference if I bind the socket to an endpoint.
  What am I doing wrong?</p>