.TH "ost::UDPTransmit" 3 "Sun Dec 27 2020" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH 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\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBost::UDPSocket\fP\&. .PP Inherited by \fBost::UDPDuplex\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "ssize_t \fBtransmit\fP (const char *buffer, size_t len)" .br .RI "Transmit 'send' to use 'connected' send rather than sendto\&. " .ti -1c .RI "bool \fBisOutputReady\fP (unsigned long timeout=0l)" .br .RI "See if output queue is empty for sending more packets\&. " .ti -1c .RI "\fBError\fP \fBsetRouting\fP (bool enable)" .br .ti -1c .RI "\fBError\fP \fBsetTypeOfService\fP (\fBTos\fP tos)" .br .ti -1c .RI "\fBError\fP \fBsetBroadcast\fP (bool enable)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBUDPTransmit\fP (\fBFamily\fP \fBfamily\fP=\fBIPV4\fP)" .br .RI "Create a UDP transmitter\&. " .ti -1c .RI "\fBUDPTransmit\fP (const \fBIPV4Address\fP &bind, \fBtpport_t\fP port=5005)" .br .RI "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\&. " .ti -1c .RI "\fBUDPTransmit\fP (const \fBIPV6Address\fP &bind, \fBtpport_t\fP port=5005)" .br .ti -1c .RI "\fBError\fP \fBconnect\fP (const \fBIPV4Host\fP &host, \fBtpport_t\fP port)" .br .RI "Associate this socket with a specified peer host\&. " .ti -1c .RI "\fBError\fP \fBconnect\fP (const \fBIPV6Address\fP &host, \fBtpport_t\fP port)" .br .ti -1c .RI "\fBError\fP \fBconnect\fP (const \fBIPV4Broadcast\fP &subnet, \fBtpport_t\fP port)" .br .RI "Associate this socket with a subnet of peer hosts for subnet broadcasting\&. " .ti -1c .RI "\fBError\fP \fBconnect\fP (const \fBIPV4Multicast\fP &mgroup, \fBtpport_t\fP port)" .br .RI "Associate this socket with a multicast group\&. " .ti -1c .RI "\fBError\fP \fBconnect\fP (const \fBIPV6Multicast\fP &mgroup, \fBtpport_t\fP port)" .br .ti -1c .RI "ssize_t \fBsend\fP (const void *buf, size_t len)" .br .RI "Transmit 'send' to use 'connected' send rather than sendto\&. " .ti -1c .RI "void \fBendTransmitter\fP (void)" .br .RI "Stop transmitter\&. " .ti -1c .RI "\fBSOCKET\fP \fBgetTransmitter\fP (void)" .br .ti -1c .RI "\fBError\fP \fBsetMulticast\fP (bool enable)" .br .ti -1c .RI "\fBError\fP \fBsetTimeToLive\fP (unsigned char \fBttl\fP)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP Representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet\&. .PP \fBAuthor\fP .RS 4 David Sugar dyfet@ostel.com .RE .PP Unreliable Datagram Peer Associations\&. .SH "Constructor & Destructor Documentation" .PP .SS "ost::UDPTransmit::UDPTransmit (\fBFamily\fP family = \fC\fBIPV4\fP\fP)\fC [protected]\fP" .PP Create a UDP transmitter\&. .SS "ost::UDPTransmit::UDPTransmit (const \fBIPV4Address\fP & bind, \fBtpport_t\fP port = \fC5005\fP)\fC [protected]\fP" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIbind\fP address to bind this socket to\&. .br \fIport\fP number to bind this socket to\&. .RE .PP .SS "ost::UDPTransmit::UDPTransmit (const \fBIPV6Address\fP & bind, \fBtpport_t\fP port = \fC5005\fP)\fC [protected]\fP" .SH "Member Function Documentation" .PP .SS "\fBError\fP ost::UDPTransmit::connect (const \fBIPV4Broadcast\fP & subnet, \fBtpport_t\fP port)\fC [protected]\fP" .PP Associate this socket with a subnet of peer hosts for subnet broadcasting\&. The server must be able to assert broadcast permission for the socket\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE .PP \fBParameters\fP .RS 4 \fIsubnet\fP subnet address to broadcast into\&. .br \fIport\fP transport port to broadcast into\&. .RE .PP .SS "\fBError\fP ost::UDPTransmit::connect (const \fBIPV4Host\fP & host, \fBtpport_t\fP port)\fC [protected]\fP" .PP 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\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE .PP \fBParameters\fP .RS 4 \fIhost\fP address to connect socket to\&. .br \fIport\fP to connect socket to\&. .RE .PP .SS "\fBError\fP ost::UDPTransmit::connect (const \fBIPV4Multicast\fP & mgroup, \fBtpport_t\fP port)\fC [protected]\fP" .PP Associate this socket with a multicast group\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE .PP \fBParameters\fP .RS 4 \fImgroup\fP address of the multicast group to send to\&. .br \fIport\fP port number .RE .PP .SS "\fBError\fP ost::UDPTransmit::connect (const \fBIPV6Address\fP & host, \fBtpport_t\fP port)\fC [protected]\fP" .SS "\fBError\fP ost::UDPTransmit::connect (const \fBIPV6Multicast\fP & mgroup, \fBtpport_t\fP port)\fC [protected]\fP" .SS "void ost::UDPTransmit::endTransmitter (void)\fC [inline]\fP, \fC [protected]\fP" .PP Stop transmitter\&. .PP References ost::Socket::endSocket()\&. .SS "\fBSOCKET\fP ost::UDPTransmit::getTransmitter (void)\fC [inline]\fP, \fC [protected]\fP" .SS "bool ost::UDPTransmit::isOutputReady (unsigned long timeout = \fC0l\fP)\fC [inline]\fP" .PP See if output queue is empty for sending more packets\&. .PP \fBReturns\fP .RS 4 true if output available\&. .RE .PP \fBParameters\fP .RS 4 \fItimeout\fP in milliseconds to wait\&. .RE .PP .PP References ost::Socket::isPending(), and ost::Socket::pendingOutput\&. .SS "ssize_t ost::UDPTransmit::send (const void * buf, size_t len)\fC [inline]\fP, \fC [protected]\fP" .PP Transmit 'send' to use 'connected' send rather than sendto\&. .PP \fBReturns\fP .RS 4 number of bytes sent\&. .RE .PP \fBParameters\fP .RS 4 \fIbuf\fP address of buffer to send\&. .br \fIlen\fP of bytes to send\&. .RE .PP .PP References _IOLEN64, and MSG_NOSIGNAL\&. .SS "\fBError\fP ost::UDPTransmit::setBroadcast (bool enable)\fC [inline]\fP" .PP References ost::Socket::setBroadcast()\&. .SS "\fBError\fP ost::UDPTransmit::setMulticast (bool enable)\fC [inline]\fP, \fC [protected]\fP" .PP References ost::Socket::setMulticastByFamily()\&. .SS "\fBError\fP ost::UDPTransmit::setRouting (bool enable)\fC [inline]\fP" .PP References ost::Socket::setRouting()\&. .SS "\fBError\fP ost::UDPTransmit::setTimeToLive (unsigned char ttl)\fC [inline]\fP, \fC [protected]\fP" .PP References ost::Socket::setTimeToLiveByFamily()\&. .SS "\fBError\fP ost::UDPTransmit::setTypeOfService (\fBTos\fP tos)\fC [inline]\fP" .PP References ost::Socket::setTypeOfService()\&. .SS "ssize_t ost::UDPTransmit::transmit (const char * buffer, size_t len)\fC [inline]\fP" .PP Transmit 'send' to use 'connected' send rather than sendto\&. .PP \fBNote\fP .RS 4 Windows does not support MSG_DONTWAIT, so it is defined as 0 on that platform\&. .RE .PP \fBReturns\fP .RS 4 number of bytes sent\&. .RE .PP \fBParameters\fP .RS 4 \fIbuffer\fP address of buffer to send\&. .br \fIlen\fP of bytes to send\&. .RE .PP .PP References _IOLEN64, MSG_DONTWAIT, and MSG_NOSIGNAL\&. .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.