beast-websockets

How to pass read handler to async_read for Beast websocket?

懵懂的女人 提交于 2019-12-11 03:37:02
问题 How do I pass in a callback to async_read ? I tried the following but it won't compile. I based this off of modifying code from the docs #include <beast/core.hpp> #include <beast/http.hpp> #include <beast/version.hpp> #include <boost/asio.hpp> #include <beast/websocket.hpp> #include <boost/bind.hpp> #include <iostream> #include <fstream> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <unistd.h> using tcp = boost::asio::ip::tcp; namespace http = beast::http; namespace