net#

namespace heph
namespace concurrency#
template<>
struct SenderExpressionImpl<heph::net::ConnectT<void>> : public heph::net::internal::ConnectSender#
namespace net#
template<typename TagT>
struct ConnectT#

Public Functions

inline auto operator()(const Socket &socket, const Endpoint &endpoint) const#

Variables

ConnectT<void> connect = {}#
namespace heph
namespace net

Enums

enum class EndpointType : std::uint8_t#

Values:

enumerator IPV4#
enumerator IPV6#
enumerator BT#
enumerator INVALID#

Functions

std::string format_as(const Endpoint &endpoint)#
class Endpoint#

Public Functions

Endpoint() = default#
~Endpoint() = default#
Endpoint(const Endpoint&) = default#
Endpoint(Endpoint&&) = default#
Endpoint &=default operator= (const Endpoint &)
Endpoint &=default operator= (Endpoint &&)
std::span<const std::byte> nativeHandle() const#
std::span<std::byte> nativeHandle()#
inline auto type() const#
std::string address() const#
std::uint16_t port() const#

Public Static Functions

static Endpoint createIpV4(const std::string &ip = "", std::uint16_t port = 0)#
static Endpoint createIpV6(const std::string &ip = "", std::uint16_t port = 0)#
static Endpoint createBt(const std::string &mac = "", std::uint16_t psm = 0)#
namespace heph
namespace concurrency
template<bool RecvAll>
struct SenderExpressionImpl<heph::net::RecvT<RecvAll>> : public heph::net::internal::RecvSender<RecvAll>#
namespace net
template<bool SendAll>
struct RecvT#

Public Functions

inline auto operator()(const Socket &socket, std::span<std::byte> buffer) const#

Variables

RecvT<false> recv = {}#
RecvT<true> recvAll = {}#
namespace heph
namespace net
class Acceptor#

Public Functions

void listen(int backlog = DEFAULT_BACKLOG) const#
void bind(const Endpoint &endpoint) const#
Endpoint localEndpoint() const#
int nativeHandle() const#
inline auto type() const#
inline concurrency::Context &context() const#

Public Static Attributes

static int DEFAULT_BACKLOG = 10#

Public Static Functions

static Acceptor createTcpIpV4(concurrency::Context &context)#
static Acceptor createTcpIpV6(concurrency::Context &context)#
static Acceptor createL2cap(concurrency::Context &context)#
namespace heph
namespace net
namespace heph
namespace net

Enums

enum class SocketType : std::uint8_t#

Values:

enumerator TCP#
enumerator UDP#
enumerator L2CAP#
enumerator INVALID#
class Socket#

Public Functions

Socket() = default#
~Socket() noexcept#
Socket(const Socket&) = delete#
Socket &=delete operator= (const Socket &)
Socket(Socket &&other) noexcept#
Socket &operator=(Socket &&other) noexcept#
inline auto type() const#
void close() noexcept#
void bind(const Endpoint &endpoint) const#
void connect(const Endpoint &endpoint) const#
Endpoint localEndpoint() const#
Endpoint remoteEndpoint() const#
inline int nativeHandle() const#
inline concurrency::Context &context() const#
inline auto maximumRecvSize() const#
inline auto maximumSendSize() const#

Public Static Functions

static Socket createTcpIpV4(concurrency::Context &context)#
static Socket createTcpIpV6(concurrency::Context &context)#
static Socket createUdpIpV4(concurrency::Context &context)#
static Socket createUdpIpV6(concurrency::Context &context)#
static Socket createL2cap(concurrency::Context &context)#
namespace heph
namespace concurrency
template<>
struct SenderExpressionImpl<heph::net::AcceptT<void>> : public heph::net::internal::AcceptSender#
namespace net
template<typename TagT>
struct AcceptT#

Public Functions

inline auto operator()(const Acceptor &acceptor) const#

Variables

AcceptT<void> accept = {}#
namespace heph
namespace concurrency
template<bool sendAll>
struct SenderExpressionImpl<heph::net::SendT<sendAll>> : public heph::net::internal::SendSender<sendAll>#
namespace net
template<bool SendAll>
struct SendT#

Public Functions

inline auto operator()(const Socket &socket, std::span<const std::byte> buffer) const#

Variables

SendT<false> send = {}#
SendT<true> sendAll = {}#