Sophie

Sophie

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

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

\section{ost::TCPV6Socket Class Reference}
\label{classost_1_1_t_c_p_v6_socket}\index{ost::TCPV6Socket@{ost::TCPV6Socket}}
TCPV6 sockets are used for stream based connected sessions between two ipv6 sockets.bound server for TCP streams and sessions.  


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

Inheritance diagram for ost::TCPV6Socket::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classost_1_1_t_c_p_v6_socket}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf on\-Accept} (const {\bf IPV6Host} \&ia, {\bf tpport\_\-t} port)
\begin{CompactList}\small\item\em A method to call in a derived {\bf TCPSocket}{\rm (p.\,\pageref{classost_1_1_t_c_p_socket})} class that is acting as a server when a connection request is being accepted. \item\end{CompactList}\item 
{\bf SOCKET} {\bf get\-Socket} (void)
\begin{CompactList}\small\item\em Fetch out the socket. \item\end{CompactList}\item 
int {\bf get\-Segment\-Size} (void)
\item 
{\bf TCPV6Socket} (const {\bf IPV6Address} \&bind, {\bf tpport\_\-t} port, unsigned backlog=5, unsigned mss=536)
\begin{CompactList}\small\item\em A TCP \char`\"{}server\char`\"{} is created as a TCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests. \item\end{CompactList}\item 
{\bf TCPV6Socket} (const char $\ast$name, unsigned backlog=5, unsigned mss=536)
\begin{CompactList}\small\item\em Create a TCP server for a named host interface and service port. \item\end{CompactList}\item 
{\bf IPV6Host} {\bf get\-Request} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em Return address and port of next connection request. \item\end{CompactList}\item 
void {\bf reject} (void)
\begin{CompactList}\small\item\em Used to reject the next incoming connection request. \item\end{CompactList}\item 
{\bf IPV6Host} {\bf get\-Local} ({\bf tpport\_\-t} $\ast$port=NULL) const 
\begin{CompactList}\small\item\em Used to get local bound address. \item\end{CompactList}\item 
bool {\bf is\-Pending\-Connection} ({\bf timeout\_\-t} timeout=TIMEOUT\_\-INF)
\begin{CompactList}\small\item\em Used to wait for pending connection requests. \item\end{CompactList}\item 
virtual {\bf $\sim$TCPV6Socket} ()
\begin{CompactList}\small\item\em Use base socket handler for ending this socket. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
TCPV6 sockets are used for stream based connected sessions between two ipv6 sockets.bound server for TCP streams and sessions. 

Both error recovery and flow control operate transparently for a TCP socket connection. The TCP socket base class is primary used to bind a TCP \char`\"{}server\char`\"{} for accepting TCP streams.

An implicit and unique {\bf TCPV6Socket}{\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket})} object exists in Common C++ to represent a bound ipv6 TCP socket acting as a \char`\"{}server\char`\"{} for receiving connection requests. This class is not part of {\bf TCPStream}{\rm (p.\,\pageref{classost_1_1_t_c_p_stream})} because such objects normally perform no physical I/O (read or write operations) other than to specify a listen backlog queue and perform \char`\"{}accept\char`\"{} operations for pending connections. The Common C++ {\bf TCPV6Socket}{\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket})} offers a Peek method to examine where the next pending connection is coming from, and a Reject method to flush the next request from the queue without having to create a session.

The {\bf TCPV6Socket}{\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket})} also supports a \char`\"{}On\-Accept\char`\"{} method which can be called when a {\bf TCPStream}{\rm (p.\,\pageref{classost_1_1_t_c_p_stream})} related object is created from a {\bf TCPSocket}{\rm (p.\,\pageref{classost_1_1_t_c_p_socket})}. By creating a {\bf TCPStream}{\rm (p.\,\pageref{classost_1_1_t_c_p_stream})} from a {\bf TCPV6Socket}{\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket})}, an accept operation automatically occurs, and the {\bf TCPV6Socket}{\rm (p.\,\pageref{classost_1_1_t_c_p_v6_socket})} can then still reject the client connection through the return status of it's On\-Accept method.

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




\subsection{Constructor \& Destructor Documentation}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!TCPV6Socket@{TCPV6Socket}}
\index{TCPV6Socket@{TCPV6Socket}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::TCPV6Socket::TCPV6Socket (const {\bf IPV6Address} \& {\em bind}, {\bf tpport\_\-t} {\em port}, unsigned {\em backlog} = {\tt 5}, unsigned {\em mss} = {\tt 536})}\label{classost_1_1_t_c_p_v6_socket_c0f58056dce530693660bcb6aa4591b1}


A TCP \char`\"{}server\char`\"{} is created as a TCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests. 

If the server cannot be created, an exception is thrown.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bind}]local ip address or interface to use. \item[{\em port}]number to bind socket under. \item[{\em backlog}]size of connection request queue. \item[{\em mss}]maximum segment size of streaming buffer. \end{description}
\end{Desc}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!TCPV6Socket@{TCPV6Socket}}
\index{TCPV6Socket@{TCPV6Socket}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::TCPV6Socket::TCPV6Socket (const char $\ast$ {\em name}, unsigned {\em backlog} = {\tt 5}, unsigned {\em mss} = {\tt 536})}\label{classost_1_1_t_c_p_v6_socket_c9dc509341430ce81bfef85ecacc06ec}


Create a TCP server for a named host interface and service port. 

We use [host/]port for specifying the optional host name and service port since ':' is a valid char for ipv6 addresses.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]of host interface and service to use. \item[{\em backlog}]size of connection request queue. \item[{\em mss}]maximum segment size of streaming buffers. \end{description}
\end{Desc}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!~TCPV6Socket@{$\sim$TCPV6Socket}}
\index{~TCPV6Socket@{$\sim$TCPV6Socket}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::TCPV6Socket::$\sim$TCPV6Socket ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_t_c_p_v6_socket_147770433d2db2f83cf4b7764cf93d69}


Use base socket handler for ending this socket. 



\subsection{Member Function Documentation}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!getLocal@{getLocal}}
\index{getLocal@{getLocal}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::TCPV6Socket::get\-Local ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_t_c_p_v6_socket_c886cc40d05790837f9a52bde00c6170}


Used to get local bound address. 



Reimplemented from {\bf ost::Socket} {\rm (p.\,\pageref{classost_1_1_socket_ca71d871bfda4dfcab0891cb0c8df1d4})}.\index{ost::TCPV6Socket@{ost::TCPV6Socket}!getRequest@{getRequest}}
\index{getRequest@{getRequest}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV6Host} ost::TCPV6Socket::get\-Request ({\bf tpport\_\-t} $\ast$ {\em port} = {\tt NULL}) const\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_t_c_p_v6_socket_2afe9be7e5c2390b5d6cf5c18c705a9c}


Return address and port of next connection request. 

This can be used instead of On\-Accept() to pre-evaluate connection requests.

\begin{Desc}
\item[Returns:]host requesting a connection. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]number of requestor. \end{description}
\end{Desc}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!getSegmentSize@{getSegmentSize}}
\index{getSegmentSize@{getSegmentSize}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::TCPV6Socket::get\-Segment\-Size (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_t_c_p_v6_socket_8381cf05daeccc8f78c56a2e1cf33370}


\index{ost::TCPV6Socket@{ost::TCPV6Socket}!getSocket@{getSocket}}
\index{getSocket@{getSocket}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf SOCKET} ost::TCPV6Socket::get\-Socket (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_t_c_p_v6_socket_cede992ad26a20072d38716d44f243dc}


Fetch out the socket. 

\index{ost::TCPV6Socket@{ost::TCPV6Socket}!isPendingConnection@{isPendingConnection}}
\index{isPendingConnection@{isPendingConnection}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::TCPV6Socket::is\-Pending\-Connection ({\bf timeout\_\-t} {\em timeout} = {\tt TIMEOUT\_\-INF})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_t_c_p_v6_socket_490ee599f8bdb269f359f33cc7862845}


Used to wait for pending connection requests. 

\begin{Desc}
\item[Returns:]true if data packets available. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]in milliseconds. TIMEOUT\_\-INF if not specified. \end{description}
\end{Desc}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!onAccept@{onAccept}}
\index{onAccept@{onAccept}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool ost::TCPV6Socket::on\-Accept (const {\bf IPV6Host} \& {\em ia}, {\bf tpport\_\-t} {\em port})\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_t_c_p_v6_socket_1863a06335cfa738b29e8512fdf7ce9c}


A method to call in a derived {\bf TCPSocket}{\rm (p.\,\pageref{classost_1_1_t_c_p_socket})} class that is acting as a server when a connection request is being accepted. 

The server can implement protocol specific rules to exclude the remote socket from being accepted by returning false. The Peek method can also be used for this purpose.

\begin{Desc}
\item[Returns:]true if client should be accepted. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ia}]internet host address of the client. \item[{\em port}]number of the client. \end{description}
\end{Desc}
\index{ost::TCPV6Socket@{ost::TCPV6Socket}!reject@{reject}}
\index{reject@{reject}!ost::TCPV6Socket@{ost::TCPV6Socket}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::TCPV6Socket::reject (void)}\label{classost_1_1_t_c_p_v6_socket_9696212802a5b000f0817a8146be904f}


Used to reject the next incoming connection request. 



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