mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
replaced boost::asio::io_service by boost::asio:io_context
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
@@ -254,7 +254,7 @@ namespace client
|
||||
void Start ();
|
||||
void Stop ();
|
||||
|
||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
||||
auto& GetService () { return GetIOService (); };
|
||||
void AddDestination (const std::string& name, std::shared_ptr<BOBDestination> dest);
|
||||
void DeleteDestination (const std::string& name);
|
||||
std::shared_ptr<BOBDestination> FindDestination (const std::string& name);
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace client
|
||||
}
|
||||
|
||||
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (
|
||||
boost::asio::io_service& service, bool isPublic,
|
||||
boost::asio::io_context& service, bool isPublic,
|
||||
i2p::data::SigningKeyType sigType, i2p::data::CryptoKeyType cryptoType,
|
||||
const std::map<std::string, std::string> * params)
|
||||
{
|
||||
@@ -399,7 +399,7 @@ namespace client
|
||||
return localDestination;
|
||||
}
|
||||
|
||||
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (boost::asio::io_service& service,
|
||||
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (boost::asio::io_context& service,
|
||||
const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params)
|
||||
{
|
||||
auto it = m_Destinations.find (keys.GetPublic ()->GetIdentHash ());
|
||||
|
||||
@@ -79,13 +79,13 @@ namespace client
|
||||
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
||||
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
||||
const std::map<std::string, std::string> * params = nullptr); // used by SAM only
|
||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_service& service,
|
||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_context& service,
|
||||
bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
||||
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
||||
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
||||
const std::map<std::string, std::string> * params = nullptr);
|
||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_service& service,
|
||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_context& service,
|
||||
const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
||||
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
||||
std::shared_ptr<ClientDestination> CreateNewMatchedTunnelDestination(const i2p::data::PrivateKeys &keys,
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace i2p
|
||||
namespace client
|
||||
{
|
||||
|
||||
I2CPDestination::I2CPDestination (boost::asio::io_service& service, std::shared_ptr<I2CPSession> owner,
|
||||
I2CPDestination::I2CPDestination (boost::asio::io_context& service, std::shared_ptr<I2CPSession> owner,
|
||||
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
||||
const std::map<std::string, std::string>& params):
|
||||
LeaseSetDestination (service, isPublic, ¶ms),
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace client
|
||||
{
|
||||
public:
|
||||
|
||||
I2CPDestination (boost::asio::io_service& service, std::shared_ptr<I2CPSession> owner,
|
||||
I2CPDestination (boost::asio::io_context& service, std::shared_ptr<I2CPSession> owner,
|
||||
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
||||
const std::map<std::string, std::string>& params);
|
||||
~I2CPDestination () {};
|
||||
@@ -227,7 +227,7 @@ namespace client
|
||||
|
||||
void Start ();
|
||||
void Stop ();
|
||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
||||
auto& GetService () { return GetIOService (); };
|
||||
bool IsSingleThread () const { return m_IsSingleThread; };
|
||||
|
||||
bool InsertSession (std::shared_ptr<I2CPSession> session);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace client
|
||||
}
|
||||
void CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, uint16_t port = 0);
|
||||
void CreateStream(StreamRequestComplete complete, std::shared_ptr<const Address> address, uint16_t port);
|
||||
inline boost::asio::io_service& GetService () { return m_LocalDestination->GetService (); }
|
||||
auto& GetService () { return m_LocalDestination->GetService (); }
|
||||
|
||||
virtual void Start () = 0;
|
||||
virtual void Stop () = 0;
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace client
|
||||
void Start ();
|
||||
void Stop ();
|
||||
|
||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
||||
auto& GetService () { return GetIOService (); };
|
||||
std::shared_ptr<SAMSession> CreateSession (const std::string& id, SAMSessionType type, const std::string& destination, // empty string means transient
|
||||
const std::map<std::string, std::string> * params);
|
||||
bool AddSession (std::shared_ptr<SAMSession> session);
|
||||
|
||||
Reference in New Issue
Block a user