Boost logo

Boost Users :

Subject: Re: [Boost-users] UDP: socket::open does not take an endpoint
From: niXman (i.nixman_at_[hidden])
Date: 2013-05-08 16:15:21


2013/5/9 Chris Stankevitz

> Question 1:
>
> Why doesn't boost UDP allow me to use method (b) with an endpoint?
> For example, this is impossible:
>
> boost::asio::ip::udp::socket Socket(IoService);
>
> Socket.open(boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 13));
>
> // error: open does not take a boost::asio::ip::udp::endpoint

Hi,

You need to use connect() member function.
http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/reference/basic_datagram_socket/connect.html

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows:
http://sourceforge.net/projects/mingwbuilds/
___________________________________________________
Another online IDE: http://liveworkspace.org/

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net