Boost logo

Boost Users :

Subject: [Boost-users] Use of socket
From: Johan Mazel (johan.mazel_at_[hidden])
Date: 2009-01-22 11:10:11


Hi
I'm trying to create some code based on the code of the socket tutorial of
the boost website.

The code to create a UDP socket which will send datagram is the following
one :

boost::asio::io_service io_service;

udp::resolver resolver(io_service);
udp::resolver::query query(udp::v4(), argv[1], "daytime");
udp::endpoint receiver_endpoint = *resolver.resolve(query);

udp::socket socket(io_service);
socket.open(udp::v4());

But, to send something else than a Daytime request, I need to know what are
the avalaible option to put instead of "daytime" in this line :

udp::resolver::query query(udp::v4(), argv[1], "daytime");

Unfortunately and as far sa I know, the documentation is quite light about
that. The only that I found is this one :
http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/reference/ip__basic_resolver/query.htmland
it is quite empty.

Eventually, my goal is to use a specified port instead of a name of service.

Thanks in advance for the help.
Johan



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