mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
server I2PTunnel
This commit is contained in:
parent
7e0a2ae5ab
commit
6c510fadf4
4 changed files with 100 additions and 4 deletions
25
I2PTunnel.h
25
I2PTunnel.h
|
@ -20,6 +20,8 @@ namespace stream
|
|||
|
||||
I2PTunnelConnection (boost::asio::ip::tcp::socket * socket,
|
||||
const i2p::data::LeaseSet * leaseSet);
|
||||
I2PTunnelConnection (Stream * stream, boost::asio::ip::tcp::socket * socket,
|
||||
const boost::asio::ip::tcp::endpoint& target);
|
||||
~I2PTunnelConnection ();
|
||||
|
||||
private:
|
||||
|
@ -32,6 +34,7 @@ namespace stream
|
|||
|
||||
void StreamReceive ();
|
||||
void HandleStreamReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred);
|
||||
void HandleConnect (const boost::system::error_code& ecode);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -64,6 +67,28 @@ namespace stream
|
|||
const i2p::data::LeaseSet * m_RemoteLeaseSet;
|
||||
std::set<I2PTunnelConnection *> m_Connections;
|
||||
};
|
||||
|
||||
class I2PServerTunnel
|
||||
{
|
||||
public:
|
||||
|
||||
I2PServerTunnel (boost::asio::io_service& service, const std::string& address, int port,
|
||||
const i2p::data::IdentHash& localDestination);
|
||||
|
||||
void Start ();
|
||||
void Stop ();
|
||||
|
||||
private:
|
||||
|
||||
void Accept ();
|
||||
void HandleAccept (Stream * stream);
|
||||
|
||||
private:
|
||||
|
||||
boost::asio::io_service& m_Service;
|
||||
StreamingDestination * m_LocalDestination;
|
||||
boost::asio::ip::tcp::endpoint m_Endpoint;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue