---
title: llarp::quic::Client

---

# llarp::quic::Client





Inherits from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[Client](Classes/classllarp_1_1quic_1_1Client.md#function-client)**([EndpointBase](Classes/classllarp_1_1EndpointBase.md) & ep, const [SockAddr](Classes/structllarp_1_1SockAddr.md) & remote, uint16_t pseudo_port) |
| std::shared_ptr< [Connection](Classes/classllarp_1_1quic_1_1Connection.md) > | **[get_connection](Classes/classllarp_1_1quic_1_1Client.md#function-get-connection)**() |

## Additional inherited members

**Protected Classes inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| struct | **[version_info](Classes/structllarp_1_1quic_1_1Endpoint_1_1version__info.md)**  |

**Protected Types inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| using std::shared_ptr< [Connection](Classes/classllarp_1_1quic_1_1Connection.md) > | **[primary_conn_ptr](Classes/classllarp_1_1quic_1_1Endpoint.md#using-primary-conn-ptr)**  |
| using std::weak_ptr< [Connection](Classes/classllarp_1_1quic_1_1Connection.md) > | **[alias_conn_ptr](Classes/classllarp_1_1quic_1_1Endpoint.md#using-alias-conn-ptr)**  |
| using decltype(conns)::iterator | **[conns_iterator](Classes/classllarp_1_1quic_1_1Endpoint.md#using-conns-iterator)**  |

**Public Functions inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| void | **[receive_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-receive-packet)**(const [SockAddr](Classes/structllarp_1_1SockAddr.md) & src, uint8_t ecn, bstring_view data)<br>Called from tun code via [TunnelManager]() to deliver an incoming packet to us.  |
| std::shared_ptr< uvw::Loop > | **[get_loop](Classes/classllarp_1_1quic_1_1Endpoint.md#function-get-loop)**()<br>Returns a shared pointer to the uvw loop.  |
| void | **[make_stateless_reset_token](Classes/classllarp_1_1quic_1_1Endpoint.md#function-make-stateless-reset-token)**(const [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md) & cid, unsigned char * dest) |
| | **[Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md#function-endpoint)**(const [Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md) & ) =delete |
| | **[Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md#function-endpoint)**([Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md) && ) =delete |

**Protected Functions inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| | **[Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md#function-endpoint)**([EndpointBase](Classes/classllarp_1_1EndpointBase.md) & service_endpoint_) |
| virtual | **[~Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md#function-~endpoint)**() |
| void | **[handle_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-handle-packet)**(const [Packet](Classes/structllarp_1_1quic_1_1Packet.md) & p) |
| std::optional< [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md) > | **[handle_packet_init](Classes/classllarp_1_1quic_1_1Endpoint.md#function-handle-packet-init)**(const [Packet](Classes/structllarp_1_1quic_1_1Packet.md) & p) |
| void | **[handle_conn_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-handle-conn-packet)**([Connection](Classes/classllarp_1_1quic_1_1Connection.md) & c, const [Packet](Classes/structllarp_1_1quic_1_1Packet.md) & p) |
| virtual std::shared_ptr< [Connection](Classes/classllarp_1_1quic_1_1Connection.md) > | **[accept_initial_connection](Classes/classllarp_1_1quic_1_1Endpoint.md#function-accept-initial-connection)**(const [Packet](Classes/structllarp_1_1quic_1_1Packet.md) & ) |
| [io_result](Classes/structllarp_1_1quic_1_1io__result.md) | **[read_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-read-packet)**(const [Packet](Classes/structllarp_1_1quic_1_1Packet.md) & p, [Connection](Classes/classllarp_1_1quic_1_1Connection.md) & conn) |
| [io_result](Classes/structllarp_1_1quic_1_1io__result.md) | **[send_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-send-packet)**(const [Address](Classes/classllarp_1_1quic_1_1Address.md) & to, bstring_view data, uint8_t ecn) |
| [io_result](Classes/structllarp_1_1quic_1_1io__result.md) | **[send_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-send-packet)**(const [Address](Classes/classllarp_1_1quic_1_1Address.md) & to, std::string_view data, uint8_t ecn) |
| [io_result](Classes/structllarp_1_1quic_1_1io__result.md) | **[send_packet](Classes/classllarp_1_1quic_1_1Endpoint.md#function-send-packet)**(const [Address](Classes/classllarp_1_1quic_1_1Address.md) & to, const std::vector< std::byte > & data, uint8_t ecn) |
| void | **[send_version_negotiation](Classes/classllarp_1_1quic_1_1Endpoint.md#function-send-version-negotiation)**(const [version_info](Classes/structllarp_1_1quic_1_1Endpoint_1_1version__info.md) & vi, const [Address](Classes/classllarp_1_1quic_1_1Address.md) & source) |
| std::pair< std::shared_ptr< [Connection](Classes/classllarp_1_1quic_1_1Connection.md) >, bool > | **[get_conn](Classes/classllarp_1_1quic_1_1Endpoint.md#function-get-conn)**(const [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md) & cid) |
| void | **[close_connection](Classes/classllarp_1_1quic_1_1Endpoint.md#function-close-connection)**([Connection](Classes/classllarp_1_1quic_1_1Connection.md) & conn, uint64_t code =NGTCP2_NO_ERROR, bool application =false, std::string_view close_reason =""sv) |
| void | **[start_draining](Classes/classllarp_1_1quic_1_1Endpoint.md#function-start-draining)**([Connection](Classes/classllarp_1_1quic_1_1Connection.md) & conn)<br>Puts a connection into draining mode (i.e.  |
| void | **[check_timeouts](Classes/classllarp_1_1quic_1_1Endpoint.md#function-check-timeouts)**() |
| bool | **[delete_conn](Classes/classllarp_1_1quic_1_1Endpoint.md#function-delete-conn)**(const [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md) & cid)<br>Deletes a connection from `conns`; if the connecion is a primary connection shared pointer then it is removed and [clean_alias_conns()]() is immediately called to remove any aliases to the connection.  |
| void | **[clean_alias_conns](Classes/classllarp_1_1quic_1_1Endpoint.md#function-clean-alias-conns)**()<br>Removes any connection id aliases that no longer have associated Connections.  |
| [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md) | **[add_connection_id](Classes/classllarp_1_1quic_1_1Endpoint.md#function-add-connection-id)**([Connection](Classes/classllarp_1_1quic_1_1Connection.md) & conn, size_t cid_length =ConnectionID::max_size())<br>Creates a new, unused connection ID alias for the given connection; adds the alias to `conns` and returns the [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md).  |

**Public Attributes inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| size_t | **[default_stream_buffer_size](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-default-stream-buffer-size)**  |
| std::array< std::byte, net::IPPacket::MaxSize > | **[buf_](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-buf-)**  |

**Protected Attributes inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| [EndpointBase](Classes/classllarp_1_1EndpointBase.md) & | **[service_endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-service-endpoint)** <br>the service endpoint we are owned by  |
| [Address](Classes/classllarp_1_1quic_1_1Address.md) | **[local_addr](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-local-addr)** <br>local "address" is the IPv6 unspecified address since we don't have (or care about) the actual local address for building quic packets.  |
| std::shared_ptr< uvw::TimerHandle > | **[expiry_timer](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-expiry-timer)**  |
| std::vector< std::byte > | **[buf](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-buf)**  |
| std::unordered_map< [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md), std::variant< primary_conn_ptr, alias_conn_ptr > > | **[conns](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-conns)**  |
| std::queue< std::pair< [ConnectionID](Classes/structllarp_1_1quic_1_1ConnectionID.md), std::chrono::steady_clock::time_point > > | **[draining](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-draining)**  |
| [NullCrypto](Classes/structllarp_1_1quic_1_1NullCrypto.md) | **[null_crypto](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-null-crypto)**  |
| std::array< std::byte, 32 > | **[static_secret](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-static-secret)**  |
| constexpr size_t | **[max_buf_size](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-max-buf-size)**  |
| constexpr size_t | **[max_pkt_size_v4](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-max-pkt-size-v4)**  |
| constexpr size_t | **[max_pkt_size_v6](Classes/classllarp_1_1quic_1_1Endpoint.md#variable-max-pkt-size-v6)**  |

**Friends inherited from [llarp::quic::Endpoint](Classes/classllarp_1_1quic_1_1Endpoint.md)**

|                | Name           |
| -------------- | -------------- |
| class | **[Connection](Classes/classllarp_1_1quic_1_1Endpoint.md#friend-connection)**  |


## Public Functions Documentation

### function Client

```cpp
Client(
    EndpointBase & ep,
    const SockAddr & remote,
    uint16_t pseudo_port
)
```


### function get_connection

```cpp
std::shared_ptr< Connection > get_connection()
```


-------------------------------

Updated on 2023-03-06 at 20:36:34 +0000