Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 804

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::UDPTransmit Class Reference}
\label{classost_1_1_u_d_p_transmit}\index{ost::UDPTransmit@{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.Unreliable Datagram Peer Associations.  


{\tt \#include $<$socket.h$>$}

Inheritance diagram for ost::UDPTransmit::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classost_1_1_u_d_p_transmit}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
ssize\_\-t {\bf transmit} (const char $\ast$buffer, size\_\-t len)
\begin{CompactList}\small\item\em Transmit \char`\"{}send\char`\"{} to use \char`\"{}connected\char`\"{} send rather than sendto. \item\end{CompactList}\item 
bool {\bf is\-Output\-Ready} (unsigned long timeout=0l)
\begin{CompactList}\small\item\em See if output queue is empty for sending more packets. \item\end{CompactList}\item 
{\bf Error} {\bf set\-Routing} (bool enable)
\item 
{\bf Error} {\bf set\-Type\-Of\-Service} ({\bf Tos} tos)
\item 
{\bf Error} {\bf set\-Broadcast} (bool enable)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf UDPTransmit} ({\bf Family} {\bf family}=IPV4)
\begin{CompactList}\small\item\em Create a UDP transmitter. \item\end{CompactList}\item 
{\bf UDPTransmit} (const {\bf IPV4Address} \&bind, {\bf tpport\_\-t} port=5005)
\begin{CompactList}\small\item\em 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. \item\end{CompactList}\item 
{\bf UDPTransmit} (const {\bf IPV6Address} \&bind, {\bf tpport\_\-t} port=5005)
\item 
{\bf Error} {\bf connect} (const {\bf IPV4Host} \&host, {\bf tpport\_\-t} port)
\begin{CompactList}\small\item\em Associate this socket with a specified peer host. \item\end{CompactList}\item 
{\bf Error} {\bf connect} (const {\bf IPV6Address} \&host, {\bf tpport\_\-t} port)
\item 
{\bf Error} {\bf connect} (const {\bf IPV4Broadcast} \&subnet, {\bf tpport\_\-t} port)
\begin{CompactList}\small\item\em Associate this socket with a subnet of peer hosts for subnet broadcasting. \item\end{CompactList}\item 
{\bf Error} {\bf connect} (const {\bf IPV4Multicast} \&mgroup, {\bf tpport\_\-t} port)
\begin{CompactList}\small\item\em Associate this socket with a multicast group. \item\end{CompactList}\item 
{\bf Error} {\bf connect} (const {\bf IPV6Multicast} \&mgroup, {\bf tpport\_\-t} port)
\item 
ssize\_\-t {\bf send} (const void $\ast$buf, size\_\-t len)
\begin{CompactList}\small\item\em Transmit \char`\"{}send\char`\"{} to use \char`\"{}connected\char`\"{} send rather than sendto. \item\end{CompactList}\item 
void {\bf end\-Transmitter} (void)
\begin{CompactList}\small\item\em Stop transmitter. \item\end{CompactList}\item 
{\bf SOCKET} {\bf get\-Transmitter} (void)
\item 
{\bf Error} {\bf set\-Multicast} (bool enable)
\item 
{\bf Error} {\bf set\-Time\-To\-Live} (unsigned char {\bf ttl})
\end{CompactItemize}


\subsection{Detailed Description}
Representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet.Unreliable Datagram Peer Associations. 

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::UDPTransmit@{ost::UDPTransmit}!UDPTransmit@{UDPTransmit}}
\index{UDPTransmit@{UDPTransmit}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::UDPTransmit::UDPTransmit ({\bf Family} {\em family} = {\tt IPV4})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_bcc795e183ac0946e15ebbbfcccc02b8}


Create a UDP transmitter. 

\index{ost::UDPTransmit@{ost::UDPTransmit}!UDPTransmit@{UDPTransmit}}
\index{UDPTransmit@{UDPTransmit}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::UDPTransmit::UDPTransmit (const {\bf IPV4Address} \& {\em bind}, {\bf tpport\_\-t} {\em port} = {\tt 5005})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_3946f1bdd89bc7ea15bd12b334ea7731}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bind}]address to bind this socket to. \item[{\em port}]number to bind this socket to. \end{description}
\end{Desc}
\index{ost::UDPTransmit@{ost::UDPTransmit}!UDPTransmit@{UDPTransmit}}
\index{UDPTransmit@{UDPTransmit}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::UDPTransmit::UDPTransmit (const {\bf IPV6Address} \& {\em bind}, {\bf tpport\_\-t} {\em port} = {\tt 5005})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_7a885da253f8e71d147368bd55100e35}




\subsection{Member Function Documentation}
\index{ost::UDPTransmit@{ost::UDPTransmit}!connect@{connect}}
\index{connect@{connect}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::connect (const {\bf IPV6Multicast} \& {\em mgroup}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_34494a97d3d5e68bc0cf02c9bad5d810}


\index{ost::UDPTransmit@{ost::UDPTransmit}!connect@{connect}}
\index{connect@{connect}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::connect (const {\bf IPV4Multicast} \& {\em mgroup}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_5e2f1e49a282bbdd4a852cf807be5022}


Associate this socket with a multicast group. 

\begin{Desc}
\item[Returns:]0 on success, -1 on error. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mgroup}]address of the multicast group to send to. \item[{\em port}]port number \end{description}
\end{Desc}
\index{ost::UDPTransmit@{ost::UDPTransmit}!connect@{connect}}
\index{connect@{connect}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::connect (const {\bf IPV4Broadcast} \& {\em subnet}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_d9ca909bb537be5b010a0aac902835c1}


Associate this socket with a subnet of peer hosts for subnet broadcasting. 

The server must be able to assert broadcast permission for the socket.

\begin{Desc}
\item[Returns:]0 on success, -1 on error. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em subnet}]subnet address to broadcast into. \item[{\em port}]transport port to broadcast into. \end{description}
\end{Desc}
\index{ost::UDPTransmit@{ost::UDPTransmit}!connect@{connect}}
\index{connect@{connect}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::connect (const {\bf IPV6Address} \& {\em host}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_3e980aa2cad3bd07ff563900d03496a6}


\index{ost::UDPTransmit@{ost::UDPTransmit}!connect@{connect}}
\index{connect@{connect}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::connect (const {\bf IPV4Host} \& {\em host}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_u_d_p_transmit_d9b9d46dfaf10ad1555c0fa08db339be}


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.

\begin{Desc}
\item[Returns:]0 on success, -1 on error. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em host}]address to connect socket to. \item[{\em port}]to connect socket to. \end{description}
\end{Desc}


Reimplemented from {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_519db2909a1c43e791e6620b758d3fdc})}.

Reimplemented in {\bf ost::UDPDuplex} {\rm (p.\,\pageref{classost_1_1_u_d_p_duplex_219b6497a5dd25e943639cfc1bbb8f81})}.\index{ost::UDPTransmit@{ost::UDPTransmit}!endTransmitter@{endTransmitter}}
\index{endTransmitter@{endTransmitter}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::UDPTransmit::end\-Transmitter (void)\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_u_d_p_transmit_fda647033eb798b91e2c2ef3b089c5b2}


Stop transmitter. 

\index{ost::UDPTransmit@{ost::UDPTransmit}!getTransmitter@{getTransmitter}}
\index{getTransmitter@{getTransmitter}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf SOCKET} ost::UDPTransmit::get\-Transmitter (void)\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_u_d_p_transmit_69b7f01eb52ae82bf91f2eefc0854918}


\index{ost::UDPTransmit@{ost::UDPTransmit}!isOutputReady@{isOutputReady}}
\index{isOutputReady@{isOutputReady}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::UDPTransmit::is\-Output\-Ready (unsigned long {\em timeout} = {\tt 0l})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_u_d_p_transmit_ddc1e1aff22446589d633bacfc436e38}


See if output queue is empty for sending more packets. 

\begin{Desc}
\item[Returns:]true if output available. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]in milliseconds to wait. \end{description}
\end{Desc}
\index{ost::UDPTransmit@{ost::UDPTransmit}!send@{send}}
\index{send@{send}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ssize\_\-t ost::UDPTransmit::send (const void $\ast$ {\em buf}, size\_\-t {\em len})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_u_d_p_transmit_c20e40569ec5502849fa3337dcfdf611}


Transmit \char`\"{}send\char`\"{} to use \char`\"{}connected\char`\"{} send rather than sendto. 

\begin{Desc}
\item[Returns:]number of bytes sent. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]address of buffer to send. \item[{\em len}]of bytes to send. \end{description}
\end{Desc}


Reimplemented from {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_4d58bb8e7a0ea0112da563bfd2eaa947})}.\index{ost::UDPTransmit@{ost::UDPTransmit}!setBroadcast@{setBroadcast}}
\index{setBroadcast@{setBroadcast}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::set\-Broadcast (bool {\em enable})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_u_d_p_transmit_86e9e41d05629a5e6f3029ace0d55e38}




Reimplemented from {\bf ost::Socket} {\rm (p.\,\pageref{classost_1_1_socket_1a507041ee5741bcdc906707b1735781})}.\index{ost::UDPTransmit@{ost::UDPTransmit}!setMulticast@{setMulticast}}
\index{setMulticast@{setMulticast}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::set\-Multicast (bool {\em enable})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_u_d_p_transmit_4e5c8fb7c2ea5f78454d303169d68b61}




Reimplemented from {\bf ost::UDPSocket} {\rm (p.\,\pageref{classost_1_1_u_d_p_socket_ce98f5833ad9834af24e78697699c912})}.\index{ost::UDPTransmit@{ost::UDPTransmit}!setRouting@{setRouting}}
\index{setRouting@{setRouting}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::set\-Routing (bool {\em enable})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_u_d_p_transmit_04ebd34e6cfc70146bfe3789c31d8903}




Reimplemented from {\bf ost::Socket} {\rm (p.\,\pageref{classost_1_1_socket_2165fdf85e39e6a8aaff3da889ae7e20})}.\index{ost::UDPTransmit@{ost::UDPTransmit}!setTimeToLive@{setTimeToLive}}
\index{setTimeToLive@{setTimeToLive}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::set\-Time\-To\-Live (unsigned char {\em ttl})\hspace{0.3cm}{\tt  [inline, protected]}}\label{classost_1_1_u_d_p_transmit_80800a55f609d62bbd8d7635f4798e6d}


\index{ost::UDPTransmit@{ost::UDPTransmit}!setTypeOfService@{setTypeOfService}}
\index{setTypeOfService@{setTypeOfService}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::UDPTransmit::set\-Type\-Of\-Service ({\bf Tos} {\em tos})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_u_d_p_transmit_11c5788901bb8c18af8428efe9c54145}


\index{ost::UDPTransmit@{ost::UDPTransmit}!transmit@{transmit}}
\index{transmit@{transmit}!ost::UDPTransmit@{ost::UDPTransmit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ssize\_\-t ost::UDPTransmit::transmit (const char $\ast$ {\em buffer}, size\_\-t {\em len})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_u_d_p_transmit_b648dd889101cf98bcad682299c48329}


Transmit \char`\"{}send\char`\"{} to use \char`\"{}connected\char`\"{} send rather than sendto. 

\begin{Desc}
\item[Note:]Windows does not support MSG\_\-DONTWAIT, so it is defined as 0 on that platform. \end{Desc}
\begin{Desc}
\item[Returns:]number of bytes sent. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buffer}]address of buffer to send. \item[{\em len}]of bytes to send. \end{description}
\end{Desc}


The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf socket.h}\end{CompactItemize}