Boost logo

Boost Users :

Subject: Re: [Boost-users] [Asio] Need help making a custom service
From: Kyle Edwards (kedwards_at_[hidden])
Date: 2015-03-10 08:28:01


On Mon, 2015-03-09 at 22:25 +0100, Bjorn Reese wrote:
> On 03/09/2015 09:34 PM, Kyle Edwards wrote:
>
> > Thanks for the suggestion. Unfortunately, though, I don't think
> > async_read_some() is going to work for me. Here is an excerpt from
>
> How do you obtain the file descriptor?

It's just a native POSIX file descriptor created with open(), like this:

int open_pin(unsigned int number)
{
  std::ostringstream filename;
  filename << "/sys/class/gpio/gpio" << number << "/value";
  return open(filename.str().c_str(), O_RDONLY | O_NONBLOCK);
}


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