MCPcopy Create free account
hub / github.com/ElementsProject/elements / StreamAccept

Method StreamAccept

src/i2p.cpp:384–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384std::unique_ptr<Sock> Session::StreamAccept()
385{
386 auto sock = Hello();
387
388 const Reply& reply = SendRequestAndGetReply(
389 *sock, strprintf("STREAM ACCEPT ID=%s SILENT=false", m_session_id), false);
390
391 const std::string& result = reply.Get("RESULT");
392
393 if (result == "OK") {
394 return sock;
395 }
396
397 if (result == "INVALID_ID") {
398 // If our session id is invalid, then force session re-creation on next usage.
399 Disconnect();
400 }
401
402 throw std::runtime_error(strprintf("\"%s\"", reply.full));
403}
404
405void Session::Disconnect()
406{

Callers

nothing calls this directly

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected