userver: utest::PortReservationOptions Struct Reference
Loading...
Searching...
No Matches
utest::PortReservationOptions Struct Reference

#include <userver/utest/port_reservation.hpp>

Detailed Description

Socket settings for a port reservation.

Definition at line 17 of file port_reservation.hpp.

Public Types

enum class  IpVersion : std::uint8_t {
  kV4 ,
  kV6
}
 Address family of the reserved socket. More...
enum class  Protocol : std::uint8_t {
  kTcp ,
  kUdp
}
 Transport protocol of the reserved socket. More...

Public Attributes

IpVersion ip_version {IpVersion::kV4}
 Address family.
Protocol protocol {Protocol::kTcp}
 Transport protocol.
std::optional< std::uint16_t > fixed_port {}
std::chrono::milliseconds timeout {std::chrono::seconds{30}}
 How long to wait for a fixed port.

Member Enumeration Documentation

◆ IpVersion

enum class utest::PortReservationOptions::IpVersion : std::uint8_t
strong

Address family of the reserved socket.

Enumerator
kV4 

IPv4.

kV6 

IPv6.

Definition at line 19 of file port_reservation.hpp.

◆ Protocol

enum class utest::PortReservationOptions::Protocol : std::uint8_t
strong

Transport protocol of the reserved socket.

Enumerator
kTcp 

TCP.

kUdp 

UDP.

Definition at line 25 of file port_reservation.hpp.

Member Data Documentation

◆ fixed_port

std::optional<std::uint16_t> utest::PortReservationOptions::fixed_port {}

Nonzero port to reserve. Otherwise the OS assigns a port. Parallel test runs in CI are likely to contend for the same fixed port. Use this option only as a last resort when the subsystem under test does not support configuring its port.

Definition at line 39 of file port_reservation.hpp.

◆ ip_version

IpVersion utest::PortReservationOptions::ip_version {IpVersion::kV4}

Address family.

Definition at line 31 of file port_reservation.hpp.

◆ protocol

Protocol utest::PortReservationOptions::protocol {Protocol::kTcp}

Transport protocol.

Definition at line 34 of file port_reservation.hpp.

◆ timeout

std::chrono::milliseconds utest::PortReservationOptions::timeout {std::chrono::seconds{30}}

How long to wait for a fixed port.

Definition at line 42 of file port_reservation.hpp.


The documentation for this struct was generated from the following file: