title: File socket I/O using UDP with Boost ASIO
body: <p>So I'm trying to use boost.log with the syslog sink on my FreeBSD servers, which run rsyslogd and listen on a file socket for UDP data. Apparently this works in FreeBSD land. Indeed the file socket is a dgram socket (telnet to a file socket is another thing which works in FreeBSD):</p>
  
  <pre><code>$ telnet /var/run/log
  Trying /var/run/log...
  /var/run/log: Protocol wrong type for socket
  </code></pre>
  
  <p>At any rate, boost.log will not communicate with a file socket, only with an IP address. My plan is to proxy information between a regular IP-based UDP server which my application relays to the file socket. In theory, this should work fine.</p>
  
  <p>However, I cannot find any way to get ASIO to communicate over UDP with a file socket, or even a file socket at all. I understand there may be ways of working with file I/O using ASIO, but this seems to be a hard Google search - nothing relevant comes up. Only a few things (on this very site) which have to deal with Windows file I/O and ASIO, at best.</p>
  
  <p>Ideally, I'd be looking for something like this (though this doesn't exist at all):</p>
  
  <pre><code>socket.send_to(boost::asio::buffer(data, length),
                 boost::asio::ip::udp::endpoint(boost::asio::ip::file_address("/var/run/log"), port);
  </code></pre>
  
  <p>But I'll take anything that'll work.</p>