197 lines
8.2 KiB
Diff
197 lines
8.2 KiB
Diff
diff --git a/src/libslic3r/GCodeSender.cpp b/src/libslic3r/GCodeSender.cpp
|
|
index 396060cbaf..a3d28f6426 100644
|
|
--- a/src/libslic3r/GCodeSender.cpp
|
|
+++ b/src/libslic3r/GCodeSender.cpp
|
|
@@ -113,7 +113,7 @@ GCodeSender::connect(std::string devname, unsigned int baud_rate)
|
|
this->io.post(boost::bind(&GCodeSender::do_read, this));
|
|
|
|
// start reading in the background thread
|
|
- boost::thread t(boost::bind(&boost::asio::io_service::run, &this->io));
|
|
+ boost::thread t(boost::bind(&boost::asio::io_context::run, &this->io));
|
|
this->background_thread.swap(t);
|
|
|
|
// always send a M105 to check for connection because firmware might be silent on connect
|
|
diff --git a/src/libslic3r/GCodeSender.hpp b/src/libslic3r/GCodeSender.hpp
|
|
index 4f266619e4..f47caef0cb 100644
|
|
--- a/src/libslic3r/GCodeSender.hpp
|
|
+++ b/src/libslic3r/GCodeSender.hpp
|
|
@@ -40,7 +40,7 @@ class GCodeSender : private boost::noncopyable {
|
|
void reset();
|
|
|
|
private:
|
|
- asio::io_service io;
|
|
+ asio::io_context io;
|
|
asio::serial_port serial;
|
|
boost::thread background_thread;
|
|
boost::asio::streambuf read_buffer, write_buffer;
|
|
diff --git a/src/slic3r/GUI/FirmwareDialog.cpp b/src/slic3r/GUI/FirmwareDialog.cpp
|
|
index a75a6e269e..d6d3c9608f 100644
|
|
--- a/src/slic3r/GUI/FirmwareDialog.cpp
|
|
+++ b/src/slic3r/GUI/FirmwareDialog.cpp
|
|
@@ -365,7 +365,7 @@ bool FirmwareDialog::priv::check_model_id()
|
|
// return true;
|
|
// }
|
|
|
|
- // asio::io_service io;
|
|
+ // asio::io_context io;
|
|
// Serial serial(io, port->port, 115200);
|
|
// serial.printer_setup();
|
|
|
|
@@ -429,7 +429,7 @@ void FirmwareDialog::priv::avr109_wait_for_bootloader(Avr109Pid usb_pid, unsigne
|
|
|
|
void FirmwareDialog::priv::avr109_reboot(const SerialPortInfo &port)
|
|
{
|
|
- asio::io_service io;
|
|
+ asio::io_context io;
|
|
Serial serial(io, port.port, 1200);
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
|
}
|
|
diff --git a/src/slic3r/GUI/FreeCADDialog.cpp b/src/slic3r/GUI/FreeCADDialog.cpp
|
|
index 822bc4e2d9..dfbb037ed0 100644
|
|
--- a/src/slic3r/GUI/FreeCADDialog.cpp
|
|
+++ b/src/slic3r/GUI/FreeCADDialog.cpp
|
|
@@ -64,7 +64,7 @@ namespace GUI {
|
|
class ExecVar {
|
|
public:
|
|
boost::process::opstream pyin;
|
|
- boost::asio::io_service ios;
|
|
+ boost::asio::io_context ios;
|
|
std::future<std::string> data_out;
|
|
std::future<std::string> data_err;
|
|
std::unique_ptr<boost::process::child> process;
|
|
diff --git a/src/slic3r/Utils/Bonjour.cpp b/src/slic3r/Utils/Bonjour.cpp
|
|
index b13d570120..d48fd87da5 100644
|
|
--- a/src/slic3r/Utils/Bonjour.cpp
|
|
+++ b/src/slic3r/Utils/Bonjour.cpp
|
|
@@ -624,7 +624,7 @@ UdpSession::UdpSession(Bonjour::ReplyFn rfn) : replyfn(rfn)
|
|
buffer.resize(DnsMessage::MAX_SIZE);
|
|
}
|
|
|
|
-UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, const asio::ip::address& interface_address, std::shared_ptr< boost::asio::io_service > io_service)
|
|
+UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, const asio::ip::address& interface_address, std::shared_ptr< boost::asio::io_context > io_service)
|
|
: replyfn(replyfn)
|
|
, multicast_address(multicast_address)
|
|
, socket(*io_service)
|
|
@@ -658,7 +658,7 @@ UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multica
|
|
}
|
|
|
|
|
|
-UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, std::shared_ptr< boost::asio::io_service > io_service)
|
|
+UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, std::shared_ptr< boost::asio::io_context > io_service)
|
|
: replyfn(replyfn)
|
|
, multicast_address(multicast_address)
|
|
, socket(*io_service)
|
|
@@ -871,7 +871,7 @@ void Bonjour::priv::lookup_perform()
|
|
{
|
|
service_dn = (boost::format("_%1%._%2%.local") % service % protocol).str();
|
|
|
|
- std::shared_ptr< boost::asio::io_service > io_service(new boost::asio::io_service);
|
|
+ std::shared_ptr< boost::asio::io_context > io_service(new boost::asio::io_context);
|
|
|
|
std::vector<LookupSocket*> sockets;
|
|
|
|
@@ -966,7 +966,7 @@ void Bonjour::priv::resolve_perform()
|
|
rpls.push_back(reply);
|
|
};
|
|
|
|
- std::shared_ptr< boost::asio::io_service > io_service(new boost::asio::io_service);
|
|
+ std::shared_ptr< boost::asio::io_context > io_service(new boost::asio::io_context);
|
|
std::vector<ResolveSocket*> sockets;
|
|
|
|
// resolve interfaces - from PR#6646
|
|
diff --git a/src/slic3r/Utils/Bonjour.hpp b/src/slic3r/Utils/Bonjour.hpp
|
|
index 398adde045..436146096b 100644
|
|
--- a/src/slic3r/Utils/Bonjour.hpp
|
|
+++ b/src/slic3r/Utils/Bonjour.hpp
|
|
@@ -155,11 +155,11 @@ public:
|
|
UdpSocket(Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
, const boost::asio::ip::address& interface_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service);
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service);
|
|
|
|
UdpSocket(Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service);
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service);
|
|
|
|
void send();
|
|
void async_receive();
|
|
@@ -172,7 +172,7 @@ protected:
|
|
boost::asio::ip::address multicast_address;
|
|
boost::asio::ip::udp::socket socket;
|
|
boost::asio::ip::udp::endpoint mcast_endpoint;
|
|
- std::shared_ptr< boost::asio::io_service > io_service;
|
|
+ std::shared_ptr< boost::asio::io_context > io_service;
|
|
std::vector<BonjourRequest> requests;
|
|
};
|
|
|
|
@@ -186,7 +186,7 @@ public:
|
|
, Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
, const boost::asio::ip::address& interface_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service)
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service)
|
|
: UdpSocket(replyfn, multicast_address, interface_address, io_service)
|
|
, txt_keys(txt_keys)
|
|
, service(service)
|
|
@@ -203,7 +203,7 @@ public:
|
|
, std::string protocol
|
|
, Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service)
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service)
|
|
: UdpSocket(replyfn, multicast_address, io_service)
|
|
, txt_keys(txt_keys)
|
|
, service(service)
|
|
@@ -242,7 +242,7 @@ public:
|
|
, Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
, const boost::asio::ip::address& interface_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service)
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service)
|
|
: UdpSocket(replyfn, multicast_address, interface_address, io_service)
|
|
, hostname(hostname)
|
|
|
|
@@ -254,7 +254,7 @@ public:
|
|
ResolveSocket(const std::string& hostname
|
|
, Bonjour::ReplyFn replyfn
|
|
, const boost::asio::ip::address& multicast_address
|
|
- , std::shared_ptr< boost::asio::io_service > io_service)
|
|
+ , std::shared_ptr< boost::asio::io_context > io_service)
|
|
: UdpSocket(replyfn, multicast_address, io_service)
|
|
, hostname(hostname)
|
|
|
|
diff --git a/src/slic3r/Utils/Serial.cpp b/src/slic3r/Utils/Serial.cpp
|
|
index b44a909f8d..b21f91f4c0 100644
|
|
--- a/src/slic3r/Utils/Serial.cpp
|
|
+++ b/src/slic3r/Utils/Serial.cpp
|
|
@@ -283,11 +283,11 @@ std::vector<std::string> scan_serial_ports()
|
|
namespace asio = boost::asio;
|
|
using boost::system::error_code;
|
|
|
|
-Serial::Serial(asio::io_service& io_service) :
|
|
+Serial::Serial(asio::io_context& io_service) :
|
|
asio::serial_port(io_service)
|
|
{}
|
|
|
|
-Serial::Serial(asio::io_service& io_service, const std::string &name, unsigned baud_rate) :
|
|
+Serial::Serial(asio::io_context& io_service, const std::string &name, unsigned baud_rate) :
|
|
asio::serial_port(io_service, name)
|
|
{
|
|
set_baud_rate(baud_rate);
|
|
diff --git a/src/slic3r/Utils/Serial.hpp b/src/slic3r/Utils/Serial.hpp
|
|
index c47759795b..4452b2a914 100644
|
|
--- a/src/slic3r/Utils/Serial.hpp
|
|
+++ b/src/slic3r/Utils/Serial.hpp
|
|
@@ -43,8 +43,8 @@ extern std::vector<SerialPortInfo> scan_serial_ports_extended();
|
|
class Serial : public boost::asio::serial_port
|
|
{
|
|
public:
|
|
- Serial(boost::asio::io_service &io_service);
|
|
- Serial(boost::asio::io_service &io_service, const std::string &name, unsigned baud_rate);
|
|
+ Serial(boost::asio::io_context &io_service);
|
|
+ Serial(boost::asio::io_context &io_service, const std::string &name, unsigned baud_rate);
|
|
Serial(const Serial &) = delete;
|
|
Serial &operator=(const Serial &) = delete;
|
|
~Serial();
|