mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
4446f2fc16
* start moving quic code to use lokinet internals
28 lines
742 B
C++
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
|