Skip to content

Commit a7810f3

Browse files
authored
Dev/simple stream fix (#1129)
* fix related to ASIO changes * Update simplestream.cc
1 parent 1b48e11 commit a7810f3

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

plugins/simplestream/simplestream.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using namespace boost::asio;
1010
typedef struct plugin_t plugin_t;
1111
typedef struct stream_t stream_t;
1212
std::vector<stream_t> streams;
13-
io_service my_tcp_io_service;
13+
boost::asio::io_context my_tcp_io_context;
1414
long max_tcp_index = 0;
1515

1616
struct plugin_t {
@@ -33,10 +33,9 @@ struct stream_t {
3333
};
3434

3535
class Simple_Stream : public Plugin_Api {
36-
typedef boost::asio::io_service io_service;
37-
io_service my_io_service;
36+
boost::asio::io_context my_io_context;
3837
ip::udp::endpoint remote_endpoint;
39-
ip::udp::socket my_socket{my_io_service};
38+
ip::udp::socket my_socket{my_io_context};
4039
public:
4140

4241
Simple_Stream(){
@@ -49,7 +48,7 @@ class Simple_Stream : public Plugin_Api {
4948
stream.TGID = element["TGID"];
5049
stream.address = element["address"];
5150
stream.port = element["port"];
52-
stream.remote_endpoint = ip::udp::endpoint(ip::address::from_string(stream.address), stream.port);
51+
stream.remote_endpoint = ip::udp::endpoint(ip::make_address(stream.address), stream.port);
5352
stream.sendTGID = element.value("sendTGID",false);
5453
stream.sendJSON = element.value("sendJSON",false);
5554
stream.sendCallStart = element.value("sendCallStart",false);
@@ -265,9 +264,9 @@ class Simple_Stream : public Plugin_Api {
265264
int start(){
266265
BOOST_FOREACH (auto& stream, streams){
267266
if (stream.tcp == true){
268-
ip::tcp::socket *my_tcp_socket = new ip::tcp::socket{my_tcp_io_service};
267+
ip::tcp::socket *my_tcp_socket = new ip::tcp::socket{my_tcp_io_context};
269268
stream.tcp_socket = my_tcp_socket;
270-
stream.tcp_socket->connect(ip::tcp::endpoint( boost::asio::ip::address::from_string(stream.address), stream.port ));
269+
stream.tcp_socket->connect(ip::tcp::endpoint( ip::make_address(stream.address), stream.port ));
271270
}
272271
}
273272
my_socket.open(ip::udp::v4());

0 commit comments

Comments
 (0)