tags:

views:

120

answers:

3

Referencing an old (from 2008) discussion:

There is a compile error when trying to use boost::asio::local::stream_protocol::iostream

There was no solution on the discussion forum and I've run into the same problem, it seems.

Has there been a fix or solution for the compile error? How can I use boost::asio::local::stream_protocol::iostream?

A: 

Why you don't ask in the referred forum, where they are with this issue? You can also look at the Trac system for pending issues. If you don't find the issue, make a new one. In this way you contribute to improving Boost.

Vicente Botet Escriba
will do. the original forum did not answer, unfortunately.
brandstaetter
Have you posted to the user list or the developement list?
Vicente Botet Escriba
+1  A: 

The class stream_protocol defines no inner resolver_query type. That member type is needed for the connect function. The connect function is called inside the constructor with parameters of basic_socket_iostream. It seems to me, that the stream_protocol was not meant to act as a iostream. If you look into the stream_protocol header you even see an #if !defined(BOOST_NO_IOSTREAM) around the inner iostream type. So try to use endpoint, socket or acceptor instead.

EDIT: If you used a string, try connecting to an stream_protocol::endpoint instead. Using something different than an stream_protocol::endpoint will result definitely in this error. If this doesn't help first construct the object and after after that, use the connect method to connect to an endpoint.

EDIT: For examples of how to use stream_local try the official example.

ablaeul
Thanks, that's exactly it. There is a new example in the current boost distro (libs/asio/example/local/iostream_client.cpp) - unfortunately this only covers the client. Would a server work analogous or do you have any hint how to implement that?
brandstaetter
+1  A: 

This bug was reported on the boost trac webiste. Chris closed it as invalid and suggested using the existing boost::asio::local::stream_protocol examples.

Sam Miller