\section{Channel Class Reference}
\label{classChannel}\index{Channel@{Channel}}
The primitive socket implementation for SOAP Envelops passing. 


{\tt \#include $<$Channel.hpp$>$}

Inheritance diagram for Channel::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classChannel}
\end{center}
\end{figure}
\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Channel} ()
\item 
virtual bool {\bf Open} (std::string \&p\_\-Remote\-Node, unsigned short p\_\-Remote\-End)  throw (Channel\-Exception)
\begin{CompactList}\small\item\em Open a socket to a given remote node/server address with remote port.\item\end{CompactList}\item 
\index{Close@{Close}!Channel@{Channel}}\index{Channel@{Channel}!Close@{Close}}
virtual void {\bf Close} ()\label{classChannel_a3}

\begin{CompactList}\small\item\em Close all open sockets and clean up.\item\end{CompactList}\item 
virtual const Channel \& {\bf operator$>$$>$} (std::string \&msg)
\begin{CompactList}\small\item\em Read from a open socket and store read message in msg.\item\end{CompactList}\item 
virtual const Channel \& {\bf operator$<$$<$} (const char $\ast$msg)
\begin{CompactList}\small\item\em Write a given message (msg) to the end-point using the open socket.\item\end{CompactList}\item 
\index{GetLastError@{GetLastError}!Channel@{Channel}}\index{Channel@{Channel}!GetLastError@{GetLastError}}
virtual const std::string \& {\bf Get\-Last\-Error} ()\label{classChannel_a6}

\begin{CompactList}\small\item\em Return last error (if any).\item\end{CompactList}\item 
\index{SetTransportHandler@{SetTransportHandler}!Channel@{Channel}}\index{Channel@{Channel}!SetTransportHandler@{SetTransportHandler}}
virtual void {\bf Set\-Transport\-Handler} ({\bf Transport} $\ast$transport)\label{classChannel_a7}

\begin{CompactList}\small\item\em Set the SOAP transport handler.\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Methods}
\begin{CompactItemize}
\item 
virtual bool {\bf Init} ()
\begin{CompactList}\small\item\em OS specific initilization.\item\end{CompactList}\item 
virtual void {\bf Error} (const char $\ast$err)
\begin{CompactList}\small\item\em Report error on read/write.\item\end{CompactList}\item 
virtual void {\bf Close\-Channel} ()
\begin{CompactList}\small\item\em Close \& clean-up the open socket/system resources.\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\index{m_Sock@{m\_\-Sock}!Channel@{Channel}}\index{Channel@{Channel}!m_Sock@{m\_\-Sock}}
unsigned int {\bf m\_\-Sock}\label{classChannel_n0}

\begin{CompactList}\small\item\em Socket descriptor.\item\end{CompactList}\item 
\index{m_RemoteNode@{m\_\-RemoteNode}!Channel@{Channel}}\index{Channel@{Channel}!m_RemoteNode@{m\_\-RemoteNode}}
std::string {\bf m\_\-Remote\-Node}\label{classChannel_n1}

\begin{CompactList}\small\item\em Remote address could be IP/host-name.\item\end{CompactList}\item 
\index{m_RemoteEnd@{m\_\-RemoteEnd}!Channel@{Channel}}\index{Channel@{Channel}!m_RemoteEnd@{m\_\-RemoteEnd}}
unsigned short {\bf m\_\-Remote\-End}\label{classChannel_n2}

\begin{CompactList}\small\item\em Remote port number.\item\end{CompactList}\item 
\index{m_LastErr@{m\_\-LastErr}!Channel@{Channel}}\index{Channel@{Channel}!m_LastErr@{m\_\-LastErr}}
std::string {\bf m\_\-Last\-Err}\label{classChannel_n3}

\begin{CompactList}\small\item\em Last error as a string.\item\end{CompactList}\item 
\index{m_pTransportHandler@{m\_\-pTransportHandler}!Channel@{Channel}}\index{Channel@{Channel}!m_pTransportHandler@{m\_\-pTransportHandler}}
{\bf Transport} $\ast$ {\bf m\_\-p\-Transport\-Handler}\label{classChannel_n4}

\begin{CompactList}\small\item\em {\bf Transport} {\rm (p.\,\pageref{classTransport})} handler for validation purpose.\item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
The primitive socket implementation for SOAP Envelops passing.

Implements primitive socket connection for all platforms, for sending/receiving SOAP Envelops with given transport; This implementation abstract the low-level communications. 



\subsection{Constructor \& Destructor Documentation}
\index{Channel@{Channel}!Channel@{Channel}}
\index{Channel@{Channel}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Channel::Channel ()}\label{classChannel_a0}


Create a Channel \& initialize 

\subsection{Member Function Documentation}
\index{Channel@{Channel}!CloseChannel@{CloseChannel}}
\index{CloseChannel@{CloseChannel}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Channel::Close\-Channel ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classChannel_b2}


Close \& clean-up the open socket/system resources.

Close, and clean-up any OS specific stuff \index{Channel@{Channel}!Error@{Error}}
\index{Error@{Error}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Channel::Error (const char $\ast$ {\em err})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classChannel_b1}


Report error on read/write.

Log any errors that cause on channel usage/initilaization \index{Channel@{Channel}!Init@{Init}}
\index{Init@{Init}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Channel::Init ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classChannel_b0}


OS specific initilization.

OS specific initialization should do here

\begin{Desc}
\item[Returns: ]\par
true if successfuly initilaize OS specific stuffs. false o/w \end{Desc}
\index{Channel@{Channel}!Open@{Open}}
\index{Open@{Open}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Channel::Open (std::string \& {\em p\_\-Remote\-Node}, unsigned short {\em p\_\-Remote\-End})  throw ({\bf Channel\-Exception})\hspace{0.3cm}{\tt  [virtual]}}\label{classChannel_a2}


Open a socket to a given remote node/server address with remote port.

This channel open INET channel for the time being using primitive sockets Do we need any other type of channel; like shared memory, pipes etc. ????\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
p\_\-Remote\-Node}]End point address as hostname/IP \item[{\em 
p\_\-Remote\-End}]Port \#\end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
true if successfuly open a soket to the endpoint. o/w exception is thrown \end{Desc}
\index{Channel@{Channel}!operator<<@{operator$<$$<$}}
\index{operator<<@{operator$<$$<$}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const Channel \& Channel::operator$<$$<$ (const char $\ast$ {\em msg})\hspace{0.3cm}{\tt  [virtual]}}\label{classChannel_a5}


Write a given message (msg) to the end-point using the open socket.

Write/send a message to the remote server; sending blocks the app. we may need to do this asynchronizely; preferably either non-blocking send or pthread.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
Message}]to be written to the open channel \end{description}
\end{Desc}
\index{Channel@{Channel}!operator>>@{operator$>$$>$}}
\index{operator>>@{operator$>$$>$}!Channel@{Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const Channel \& Channel::operator$>$$>$ (std::string \& {\em msg})\hspace{0.3cm}{\tt  [virtual]}}\label{classChannel_a4}


Read from a open socket and store read message in msg.

Read/receive a message from the remote server; reading may be done in chunks.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
string}]to hold the read Message \end{description}
\end{Desc}


The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
Channel.hpp\item 
Channel.cpp\end{CompactItemize}
