mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
create streams through ClientDestination
This commit is contained in:
parent
4d97b0e206
commit
b11877d002
8 changed files with 63 additions and 21 deletions
|
@ -14,7 +14,7 @@ namespace client
|
|||
boost::asio::ip::tcp::socket * socket, const i2p::data::LeaseSet * leaseSet):
|
||||
m_Socket (socket), m_Owner (owner)
|
||||
{
|
||||
m_Stream = m_Owner->GetLocalDestination ()->GetStreamingDestination ()->CreateNewOutgoingStream (*leaseSet);
|
||||
m_Stream = m_Owner->GetLocalDestination ()->CreateStream (*leaseSet);
|
||||
m_Stream->Send (m_Buffer, 0); // connect
|
||||
StreamReceive ();
|
||||
Receive ();
|
||||
|
@ -39,7 +39,7 @@ namespace client
|
|||
if (m_Stream)
|
||||
{
|
||||
m_Stream->Close ();
|
||||
m_Owner->GetLocalDestination ()->GetStreamingDestination ()->DeleteStream (m_Stream);
|
||||
i2p::stream::DeleteStream (m_Stream);
|
||||
m_Stream = nullptr;
|
||||
}
|
||||
m_Socket->close ();
|
||||
|
@ -115,7 +115,7 @@ namespace client
|
|||
if (ecode != boost::asio::error::operation_aborted)
|
||||
{
|
||||
if (m_Stream) m_Stream->Close ();
|
||||
m_Owner->GetLocalDestination ()->GetStreamingDestination ()->DeleteStream (m_Stream);
|
||||
i2p::stream::DeleteStream (m_Stream);
|
||||
m_Stream = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ namespace client
|
|||
{
|
||||
auto localDestination = GetLocalDestination ();
|
||||
if (localDestination)
|
||||
localDestination->GetStreamingDestination ()->SetAcceptor (std::bind (&I2PServerTunnel::HandleAccept, this, std::placeholders::_1));
|
||||
localDestination->AcceptStreams (std::bind (&I2PServerTunnel::HandleAccept, this, std::placeholders::_1));
|
||||
else
|
||||
LogPrint ("Local destination not set for server tunnel");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue