ost::UDPReceive(3)
π ost::UDPReceive π β the ost::UDPReceive(3) page, but make it cute
okay bestie, so this is from the Library Functions Manual, and it's literally all about ost::UDPReceive. half of a two-way UDP connection, no big deal. she receives. that's the whole vibe. π¦
β¨ NAME β¨
ost::UDPReceive β representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. it's giving "one half of a duo and she knows it" π
πΈ SYNOPSIS πΈ
#include <socket.h>
Inherits ost::UDPSocket.
Inherited by ost::UDPDuplex.
π Public Member Functions
ssize_t receive (void *buf, size_t len)β receive a data packet from the connected peer host. yes girl, take it in π₯bool isInputReady (timeout_t timeout=TIMEOUT_INF)β see if input queue has data packets available.
π Protected Member Functions
UDPReceive (const IPV4Address &bind, tpport_t port)β create a UDP receiver, bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it, and associate it with a given port on a peer host.UDPReceive (const IPV6Address &bind, tpport_t port)Error connect (const IPV4Host &host, tpport_t port)β associate this socket with a specified peer host.Error connect (const IPV6Host &host, tpport_t port)bool isPendingReceive (timeout_t timeout)β check for pending data.void endReceiver (void)β end receiver.SOCKET getReceiver (void) constError setRouting (bool enable)Error setMulticast (bool enable)Error join (const IPV4Multicast &ia)Error join (const IPV6Multicast &ia)Error drop (const IPV4Multicast &ia)Error drop (const IPV6Multicast &ia)
β Additional Inherited Members
π¦ DETAILED DESCRIPTION π¦
Representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. iconic behaviour, honestly.
This class is used exclusivily to derive the UDPDuplex. (yes, that's the original spelling, we are not touching it, she said what she said π)
Author
David Sugar dyfet@ostel.com π
Unreliable Datagram Peer Associations. (that's the whole section title, no notes.)
π CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π
ost::UDPReceive::UDPReceive (const IPV4Address & bind, tpport_t port)
[protected]
Create a UDP receiver, bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it, and associate it with a given port on a peer host.
β οΈ On failure to bind, an exception is thrown. so like, be ready for drama.
Parameters
- bind β address to bind this socket to.
- port β number to bind this socket to.
ost::UDPReceive::UDPReceive (const IPV6Address & bind, tpport_t port)
[protected]
(that's it. that's the whole entry. she's mysterious like that.)
π MEMBER FUNCTION DOCUMENTATION π
Error ost::UDPReceive::connect (const IPV4Host & host, tpport_t port)
[protected]
Associate this socket with a specified peer host. The port number from the constructor will be used. All UDP packets will be sent received from the specified host.
Returns
0 on success, -1 on error. (binary queen, she only does two numbers β¨)
Parameters
- host β host network address to connect socket to.
- port β host transport port to connect socket to.
Error ost::UDPReceive::connect (const IPV6Host & host, tpport_t port)
[protected]
Error ost::UDPReceive::drop (const IPV4Multicast & ia)
[inline], [protected]
References ost::Socket::drop().
Error ost::UDPReceive::drop (const IPV6Multicast & ia)
[inline], [protected]
References ost::Socket::drop().
void ost::UDPReceive::endReceiver (void)
[inline], [protected]
End receiver. π bye bestie, closing up shop.
References ost::Socket::endSocket().
SOCKET ost::UDPReceive::getReceiver (void) const
[inline], [protected]
(no description, just vibes. she returns a SOCKET and that's all you're getting.)
bool ost::UDPReceive::isInputReady (timeout_t timeout = TIMEOUT_INF)
[inline]
See if input queue has data packets available. peek before you commit, always π«Ά
Returns
true if data packets available.
Parameters
- timeout β in milliseconds.
References ost::Socket::isPending(), and ost::Socket::pendingInput.
bool ost::UDPReceive::isPendingReceive (timeout_t timeout)
[inline], [protected]
Check for pending data. the suspense... the anticipation...
Returns
true if data is waiting.
Parameters
- timeout β in milliseconds.
References ost::Socket::isPending(), and ost::Socket::pendingInput.
Error ost::UDPReceive::join (const IPV4Multicast & ia)
[inline], [protected]
References ost::Socket::join().
Error ost::UDPReceive::join (const IPV6Multicast & ia)
[inline], [protected]
References ost::Socket::join().
ssize_t ost::UDPReceive::receive (void * buf, size_t len)
[inline]
Receive a data packet from the connected peer host. the main character moment of this entire class, fr fr π₯
Returns
num of bytes actually received.
Parameters
- buf β address of data receive buffer.
- len β size of data receive buffer.
References _IOLEN64.
Error ost::UDPReceive::setMulticast (bool enable)
[inline], [protected]
References ost::Socket::setMulticastByFamily().
Error ost::UDPReceive::setRouting (bool enable)
[inline], [protected]
References ost::Socket::setRouting().
π AUTHOR π
Generated automatically by Doxygen for GNU CommonC++ from the source code. (not a human authoring era, we're in robot-generated times and honestly? slay.)
and that's the whole page bestie, no cap, every single flag and reference accounted for π
this was GNU CommonC++ documentation, dated Sun Dec 27 2020, and this very page is ost::UDPReceive(3). mwah, go forth and receive your datagrams, periodt ππ¦β¨
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms