MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / CreateStream

Function CreateStream

libi2pd/api.cpp:122–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 std::shared_ptr<i2p::stream::Stream> CreateStream (std::shared_ptr<i2p::client::ClientDestination> dest, const i2p::data::IdentHash& remote)
123 {
124 if (!dest) return nullptr;
125 auto leaseSet = dest->FindLeaseSet (remote);
126 if (leaseSet)
127 {
128 auto stream = dest->CreateStream (leaseSet);
129 stream->Send (nullptr, 0); // connect
130 return stream;
131 }
132 else
133 {
134 RequestLeaseSet (dest, remote);
135 return nullptr;
136 }
137 }
138
139 void AcceptStream (std::shared_ptr<i2p::client::ClientDestination> dest, const i2p::stream::StreamingDestination::Acceptor& acceptor)
140 {

Callers 3

CreateStreamMethod · 0.85
CreateStreamMethod · 0.85
CreateStreamSyncMethod · 0.85

Calls 4

RequestLeaseSetFunction · 0.85
FindLeaseSetMethod · 0.45
CreateStreamMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected