Sophie

Sophie

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

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

\section{ost::Unix\-Session Class Reference}
\label{classost_1_1_unix_session}\index{ost::UnixSession@{ost::UnixSession}}
The Unix domain session is used to primarily to represent a client connection that can be managed on a seperate thread.Threaded streamable unix domain socket with non-blocking constructor.  


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

Inheritance diagram for ost::Unix\-Session::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classost_1_1_unix_session}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Unix\-Session} (const char $\ast$pathname, int size=512, int pri=0, int stack=0)
\begin{CompactList}\small\item\em Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread. \item\end{CompactList}\item 
{\bf Unix\-Session} ({\bf Unix\-Socket} \&server, int size=512, int pri=0, int stack=0)
\begin{CompactList}\small\item\em Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection. \item\end{CompactList}\item 
virtual {\bf $\sim$Unix\-Session} ()
\begin{CompactList}\small\item\em Virtual destructor. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
int {\bf wait\-Connection} ({\bf timeout\_\-t} {\bf timeout}=TIMEOUT\_\-INF)
\begin{CompactList}\small\item\em Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket. \item\end{CompactList}\item 
void {\bf initial} (void)
\begin{CompactList}\small\item\em The initial method is used to esablish a connection when delayed completion is used. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
The Unix domain session is used to primarily to represent a client connection that can be managed on a seperate thread.Threaded streamable unix domain socket with non-blocking constructor. 

The Unix domain session also supports a non-blocking connection scheme which prevents blocking during the constructor and moving the process of completing a connection into the thread that executes for the session.

\begin{Desc}
\item[Author:]Alex Pavloff $<${\tt alex@pavloff.net}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::UnixSession@{ost::Unix\-Session}!UnixSession@{UnixSession}}
\index{UnixSession@{UnixSession}!ost::UnixSession@{ost::Unix\-Session}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Unix\-Session::Unix\-Session (const char $\ast$ {\em pathname}, int {\em size} = {\tt 512}, int {\em pri} = {\tt 0}, int {\em stack} = {\tt 0})}\label{classost_1_1_unix_session_49e49dee2cc4b595ae78397d592b4305}


Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pathname}]path to socket \item[{\em size}]of streaming buffer. \item[{\em pri}]execution priority relative to parent. \item[{\em stack}]allocation needed on some platforms. \end{description}
\end{Desc}
\index{ost::UnixSession@{ost::Unix\-Session}!UnixSession@{UnixSession}}
\index{UnixSession@{UnixSession}!ost::UnixSession@{ost::Unix\-Session}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Unix\-Session::Unix\-Session ({\bf Unix\-Socket} \& {\em server}, int {\em size} = {\tt 512}, int {\em pri} = {\tt 0}, int {\em stack} = {\tt 0})}\label{classost_1_1_unix_session_6e9d0fe9b2b5a324240d40c6c7fb1fef}


Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em server}]unix domain socket to accept a connection from. \item[{\em size}]of streaming buffer. \item[{\em pri}]execution priority relative to parent. \item[{\em stack}]allocation needed on some platforms. \end{description}
\end{Desc}
\index{ost::UnixSession@{ost::Unix\-Session}!~UnixSession@{$\sim$UnixSession}}
\index{~UnixSession@{$\sim$UnixSession}!ost::UnixSession@{ost::Unix\-Session}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Unix\-Session::$\sim$Unix\-Session ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_unix_session_5e92890e3aa3266754531713216ba983}


Virtual destructor. 



\subsection{Member Function Documentation}
\index{ost::UnixSession@{ost::Unix\-Session}!initial@{initial}}
\index{initial@{initial}!ost::UnixSession@{ost::Unix\-Session}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Unix\-Session::initial (void)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_unix_session_5762091d1418fca6b4970c9c5a5b347f}


The initial method is used to esablish a connection when delayed completion is used. 

This assures the constructor terminates without having to wait for a connection request to complete. 

Reimplemented from {\bf ost::Thread} {\rm (p.\,\pageref{classost_1_1_thread_300c229e76725eeddc69867f7ecea91f})}.\index{ost::UnixSession@{ost::Unix\-Session}!waitConnection@{waitConnection}}
\index{waitConnection@{waitConnection}!ost::UnixSession@{ost::Unix\-Session}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Unix\-Session::wait\-Connection ({\bf timeout\_\-t} {\em timeout} = {\tt TIMEOUT\_\-INF})\hspace{0.3cm}{\tt  [protected]}}\label{classost_1_1_unix_session_5906649d95a9f93bd5bdb0f1d68b28f1}


Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket. 

One might wish to use {\bf set\-Completion()}{\rm (p.\,\pageref{classost_1_1_socket_16eb72794ce956b2af6b935eb59b2e24})} to change the socket back to blocking I/O calls after the connection completes. To implement the session one must create a derived class which implements Run().

\begin{Desc}
\item[Returns:]0 if successful, -1 if timed out. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em timeout}]to wait for completion in milliseconds. \end{description}
\end{Desc}


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