mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Make I2PClientTunnel use TCPIPAcceptor
This commit is contained in:
parent
df3e8ce937
commit
56014962d4
4 changed files with 17 additions and 54 deletions
16
I2PTunnel.h
16
I2PTunnel.h
|
@ -55,12 +55,18 @@ namespace client
|
|||
bool m_IsQuiet; // don't send destination
|
||||
};
|
||||
|
||||
class I2PClientTunnel: public I2PService
|
||||
class I2PClientTunnel: public TCPIPAcceptor
|
||||
{
|
||||
protected:
|
||||
|
||||
// Implements TCPIPAcceptor
|
||||
std::shared_ptr<I2PServiceHandler> CreateHandler(boost::asio::ip::tcp::socket * socket);
|
||||
const char* GetName() { return "I2P Client Tunnel"; }
|
||||
|
||||
public:
|
||||
|
||||
I2PClientTunnel (const std::string& destination, int port, ClientDestination * localDestination = nullptr);
|
||||
~I2PClientTunnel ();
|
||||
~I2PClientTunnel () {}
|
||||
|
||||
void Start ();
|
||||
void Stop ();
|
||||
|
@ -68,13 +74,7 @@ namespace client
|
|||
private:
|
||||
|
||||
const i2p::data::IdentHash * GetIdentHash ();
|
||||
void Accept ();
|
||||
void HandleAccept (const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket);
|
||||
|
||||
private:
|
||||
|
||||
boost::asio::ip::tcp::acceptor m_Acceptor;
|
||||
boost::asio::deadline_timer m_Timer;
|
||||
std::string m_Destination;
|
||||
const i2p::data::IdentHash * m_DestinationIdentHash;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue