lokinet/llarp/quic/client.hpp
Jeff Becker 4446f2fc16
fix and format.
* start moving quic code to use lokinet internals
2021-04-19 06:57:46 -04:00

28 lines
742 B
C++

#pragma once
#include "endpoint.hpp"
#include <optional>
namespace llarp::quic
{
class Client : public Endpoint
{
public:
// Constructs a client that establishes an outgoing connection to `remote` to tunnel packets to
// `tunnel_port` on the remote's lokinet address. `local` can be used to optionally bind to a
// local IP and/or port for the connection.
Client(service::ConvoTag remote, service::Endpoint* parent, uint16_t tunnel_port);
// Returns a reference to the client's connection to the server. Returns a nullptr if there is
// no connection.
std::shared_ptr<Connection>
get_connection();
private:
void
handle_packet(const Packet& p) override;
};
} // namespace llarp::quic