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

Method HandleAccept

libi2pd_client/SAM.cpp:1497–1517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1495 }
1496
1497 void SAMBridge::HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<SAMSocket> socket)
1498 {
1499 if (!ecode)
1500 {
1501 boost::system::error_code ec;
1502 auto ep = socket->GetSocket ().remote_endpoint (ec);
1503 if (!ec)
1504 {
1505 LogPrint (eLogDebug, "SAM: New connection from ", ep);
1506 AddSocket (socket);
1507 socket->ReceiveHandshake ();
1508 }
1509 else
1510 LogPrint (eLogError, "SAM: Incoming connection error: ", ec.message ());
1511 }
1512 else
1513 LogPrint (eLogError, "SAM: Accept error: ", ecode.message ());
1514
1515 if (ecode != boost::asio::error::operation_aborted)
1516 Accept ();
1517 }
1518
1519 std::shared_ptr<SAMSession> SAMBridge::CreateSession (std::string_view id, SAMSessionType type,
1520 std::string_view destination, const i2p::util::Mapping& params)

Callers

nothing calls this directly

Calls 3

LogPrintFunction · 0.85
GetSocketMethod · 0.80
ReceiveHandshakeMethod · 0.80

Tested by

no test coverage detected