https://github.com/bitcoin/bitcoin/commit/2b781ad66e34000037f589c71366c203255ed058#r83655059
{
    try {
        while (!*m_interrupt) {
            Sock::Event occurred;
            if (!conn.sock->Wait(MAX_WAIT_FOR_IO, Sock::RECV, &occurred)) {
                throw std::runtime_error("wait on socket failed");
            }
            if (occurred == 0) {
                
                continue;
            }
            const std::string& peer_dest =
                conn.sock->RecvUntilTerminator('\n', MAX_WAIT_FOR_IO, *m_interrupt, MAX_MSG_SIZE);
            conn.peer = CService(DestB64ToAddr(peer_dest), I2P_SAM31_PORT);
            return true;
        }
    } catch (const std::runtime_error& e) {
        Log("Error accepting: %s", e.what());
        CheckControlSock();
    }
    return false;
}
bool Session::Connect(const CService& to, Connection& conn, bool& proxy_error)