|
Boost Users : |
Subject: Re: [Boost-users] non-blocking read
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-21 10:39:06
> Â util::net::read_non_blocking(Module::_socket, buffer(buf, 4), 1);
Note that it's *blocking* read with timeout.
> undefined reference to `boost::optional<boost::system::error_code>
> util::net::read_non_blocking<boost::asio::mutable_buffers_1>(boost::asio::basic_stream_socket<boost::asio::ip::tcp,
> boost::asio::stream_socket_service<boost::asio::ip::tcp> >*,
> boost::asio::mutable_buffers_1 const&, int)
Maybe you tried to define the function template in cpp, without
explicit specialization.
Define your function templates in the header.
> Also, what will this code return exacty?
What do you mean by saying "return"? The function attempts to read
data to the buffer you suplly, and if the operation doesn't complete
in some time-interval, it throws an exception.
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