Bienvenue sur la nouvelle documentation de CppUtils !
CppUtils::Network::Socket
CLASSTypes publics
Section intitulée « Types publics »Domain;Type;ShutdownMode
Section intitulée « ShutdownMode »ShutdownMode;Méthodes et fonctions publiques
Section intitulée « Méthodes et fonctions publiques »explicit Socket::Socket( NativeSocket socket, Domain domain = Domain::IPV4, Type type = Type::TCP) noexcept;[[nodiscard]] auto Socket::shutdown(ShutdownMode mode = ShutdownMode::Both) const -> std::expected<void, std::error_code>;[[nodiscard]] auto Socket::setReuseAddress(bool enable) const -> std::expected<void, std::error_code>;template <class T>[[nodiscard]] auto Socket::getSocketOption(int level, int option) const -> std::expected<T, std::error_code>;[[nodiscard]] auto Socket::send(const void* data, std::size_t size) -> std::expected<void, std::error_code>;[[nodiscard]] auto Socket::sendDatagram(const void* data, std::size_t size, std::string_view ip, std::uint16_t port) -> std::expected<void, std::error_code>;[[nodiscard]] auto Socket::send(const std::vector<std::byte>& data) -> std::expected<void, std::error_code>;[[nodiscard]] auto Socket::sendDatagram(std::string_view string, std::string_view ip, std::uint16_t port) -> std::expected<void, std::error_code>;[[nodiscard]] auto Socket::send(const CppUtils::Type::TriviallyCopyable auto& data) -> std::expected<void, std::error_code>;template <class T>[[nodiscard]] auto Socket::receive([[maybe_unused]] std::size_t bufferSize = 1'024) -> std::expected<T, std::error_code>;[[nodiscard]] auto Socket::receive<std::vector<std::byte>>(std::size_t bufferSize) -> std::expected<std::vector<std::byte>, std::error_code>;[[nodiscard]] auto Socket::receive<std::string>(std::size_t bufferSize) -> std::expected<std::string, std::error_code>;[[nodiscard]] auto Socket::receiveDatagram(std::size_t udpBufferSize = 4'096uz) -> std::expected<Datagram, std::error_code>;