ost::UDPTransmit(3)
β¨ ost::UDPTransmit β¨
okay bestie, so this is a page from the GNU CommonC++ library functions manual, and it's all about ost::UDPTransmit π pull up a chair, we're talking UDP and it's gonna be cute.
πΈ NAME πΈ
ost::UDPTransmit β representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet. π
π¦ SYNOPSIS π¦
#include <socket.h>
Inherits ost::UDPSocket.
Inherited by ost::UDPDuplex.
π Public Member Functions
ssize_t transmit(const char *buffer, size_t len)β Transmit 'send' to use 'connected' send rather than sendto.bool isOutputReady(unsigned long timeout=0l)β See if output queue is empty for sending more packets.Error setRouting(bool enable)Error setTypeOfService(Tos tos)Error setBroadcast(bool enable)
π Protected Member Functions
UDPTransmit(Family family=IPV4)β Create a UDP transmitter.UDPTransmit(const IPV4Address &bind, tpport_t port=5005)β Create a UDP transmitter, 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.UDPTransmit(const IPV6Address &bind, tpport_t port=5005)Error connect(const IPV4Host &host, tpport_t port)β Associate this socket with a specified peer host.Error connect(const IPV6Address &host, tpport_t port)Error connect(const IPV4Broadcast &subnet, tpport_t port)β Associate this socket with a subnet of peer hosts for subnet broadcasting.Error connect(const IPV4Multicast &mgroup, tpport_t port)β Associate this socket with a multicast group.Error connect(const IPV6Multicast &mgroup, tpport_t port)ssize_t send(const void *buf, size_t len)β Transmit 'send' to use 'connected' send rather than sendto.void endTransmitter(void)β Stop transmitter.SOCKET getTransmitter(void)Error setMulticast(bool enable)Error setTimeToLive(unsigned char ttl)
π Additional Inherited Members
π DESCRIPTION π
So likeβ¦ ost::UDPTransmit is representing half of a two-way UDP connection, and the UDP transmitter can broadcast data to another selected peer host or to an entire subnet. no cap. π«Ά
Author: David Sugar dyfet@ostel.com
Unreliable Datagram Peer Associations. β (yes that's the whole vibe β unreliable datagrams, iconic honestly)
π§ Constructor & Destructor Documentation π§
π ost::UDPTransmit::UDPTransmit(Family family = IPV4) [protected]
Create a UDP transmitter.
π ost::UDPTransmit::UDPTransmit(const IPV4Address & bind, tpport_t port = 5005) [protected]
Create a UDP transmitter, 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. This class is only used to build the UDP Duplex.
Parameters
- bind β address to bind this socket to.
- port β number to bind this socket to.
π ost::UDPTransmit::UDPTransmit(const IPV6Address & bind, tpport_t port = 5005) [protected]
π Member Function Documentation π
β¨ Error ost::UDPTransmit::connect(const IPV4Broadcast & subnet, tpport_t port) [protected]
Associate this socket with a subnet of peer hosts for subnet broadcasting. The server must be able to assert broadcast permission for the socket. (permission check, bestie, don't skip it π)
Returns: 0 on success, -1 on error.
Parameters
- subnet β subnet address to broadcast into.
- port β transport port to broadcast into.
β¨ Error ost::UDPTransmit::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 to and received from the specified host.
Returns: 0 on success, -1 on error.
Parameters
- host β address to connect socket to.
- port β to connect socket to.
β¨ Error ost::UDPTransmit::connect(const IPV4Multicast & mgroup, tpport_t port) [protected]
Associate this socket with a multicast group.
Returns: 0 on success, -1 on error.
Parameters
- mgroup β address of the multicast group to send to.
- port β port number
β¨ Error ost::UDPTransmit::connect(const IPV6Address & host, tpport_t port) [protected]
β¨ Error ost::UDPTransmit::connect(const IPV6Multicast & mgroup, tpport_t port) [protected]
β¨ void ost::UDPTransmit::endTransmitter(void) [inline], [protected]
Stop transmitter.
References ost::Socket::endSocket().
β¨ SOCKET ost::UDPTransmit::getTransmitter(void) [inline], [protected]
β¨ bool ost::UDPTransmit::isOutputReady(unsigned long timeout = 0l) [inline]
See if output queue is empty for sending more packets. π
Returns: true if output available.
Parameters
- timeout β in milliseconds to wait.
References ost::Socket::isPending(), and ost::Socket::pendingOutput.
β¨ ssize_t ost::UDPTransmit::send(const void * buf, size_t len) [inline], [protected]
Transmit 'send' to use 'connected' send rather than sendto.
Returns: number of bytes sent.
Parameters
- buf β address of buffer to send.
- len β of bytes to send.
References _IOLEN64, and MSG_NOSIGNAL.
β¨ Error ost::UDPTransmit::setBroadcast(bool enable) [inline]
References ost::Socket::setBroadcast().
β¨ Error ost::UDPTransmit::setMulticast(bool enable) [inline], [protected]
References ost::Socket::setMulticastByFamily().
β¨ Error ost::UDPTransmit::setRouting(bool enable) [inline]
References ost::Socket::setRouting().
β¨ Error ost::UDPTransmit::setTimeToLive(unsigned char ttl) [inline], [protected]
References ost::Socket::setTimeToLiveByFamily().
β¨ Error ost::UDPTransmit::setTypeOfService(Tos tos) [inline]
References ost::Socket::setTypeOfService().
β¨ ssize_t ost::UDPTransmit::transmit(const char * buffer, size_t len) [inline]
Transmit 'send' to use 'connected' send rather than sendto.
Note: Windows does not supportMSG_DONTWAIT, so it is defined as0on that platform. π (windows moment, but okay)
Returns: number of bytes sent.
Parameters
- buffer β address of buffer to send.
- len β of bytes to send.
References _IOLEN64, MSG_DONTWAIT, and MSG_NOSIGNAL.
β Author β
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page bestie, literally every flag and param accounted for, ate and left no crumbs ππ this lil doc came to you from GNU CommonC++, dated Sun Dec 27 2020 β mwah, ily, go send some datagrams π¦π
π¦ 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