Code Monkey home page Code Monkey logo

mabrarov / asio_samples Goto Github PK

View Code? Open in Web Editor NEW
269.0 269.0 60.0 10.51 MB

Examples (code samples) describing the construction of active objects on the top of Boost.Asio. A code-based guide for client/server creation with usage of active object pattern by means of Boost C++ Libraries.

License: Boost Software License 1.0

CMake 22.88% C++ 64.92% Shell 2.48% Dockerfile 2.36% Batchfile 0.15% PowerShell 6.63% Smarty 0.58%
asio asynchronous boost c-plus-plus network

asio_samples's People

Contributors

mabrarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asio_samples's Issues

cyclic_buffer usage example after data read

Hi , great repo! I wonder if you have any example of using your cyclic_buffer's data after it has been filled by async_read_some.
Basically, in my scenario, i can have a lot of back to back messages on the socket, each of them in the form of 4 bytes header + payload. Cyclic buffer allows me to read as much as I can from the socket, and then to parse these bytes. And if I don;t have complete message at the end - I will issue next read_some operation to the end of the buffer.
But I don't see how I can consume the received data. I can use .data() , but how can I access underlying char* ?

Failure to compile. Must statically link to boost.

Great project by the way.

I am using VS 2015 update 2.

Is it mandatory to have -D Boost_USE_STATIC_LIBS=ON, it was the only way I could get it to compile?

My cmake batch file :

cmake -D BOOST_INCLUDEDIR=C:\Development\ThirdParty\BOOST\boost_1_60_0 -D BOOST_LIBRARYDIR=C:\Development\ThirdParty\BOOST\boost_1_60_0\lib64-msvc-14.0 -D Boost_NO_SYSTEM_PATHS=ON -D Boost_USE_STATIC_LIBS=ON -D Qt5Widgets_DIR=C:\Development\ThirdParty\QT\5.6\msvc2015_64/lib/cmake/Qt5Widgets -G "Visual Studio 14 2015 Win64" .

Fails to build with boost 1.66+

boost::asio::signal_set_service did disappear from boost 1.66. So asio_samples fails to build with

[ 71%] Building CXX object examples/ma_async_basics/CMakeFiles/ma_async_basics.dir/src/main.cpp.o
In file included from /home/reddwarf/tmp/asio_samples/libs/ma_console_close_signal/include/ma/console_close_signal.hpp:19,
                 from /home/reddwarf/tmp/asio_samples/libs/ma_console_close_signal/include/ma/console_close_guard.hpp:20,
                 from /home/reddwarf/tmp/asio_samples/examples/ma_async_basics/src/main.cpp:22:
/home/reddwarf/tmp/asio_samples/libs/ma_console_close_signal/include/ma/console_close_signal_service.hpp:40:24: error: ‘signal_set_service’ in namespace ‘boost::asio’ does not name a type
   typedef boost::asio::signal_set_service     service_impl_type;

when using it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.