-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.h
More file actions
24 lines (17 loc) · 729 Bytes
/
client.h
File metadata and controls
24 lines (17 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "endpoint.h"
#include <optional>
namespace 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(Address remote, std::shared_ptr<uvw::Loop> loop, uint16_t tunnel_port, std::optional<Address> local = std::nullopt);
// 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;
};
}