Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Channel Class Reference

The primitive socket implementation for SOAP Envelops passing. More...

#include <Channel.hpp>

List of all members.

Public Methods

 Channel ()
 ~Channel ()
bool Open (std::string &p_RemoteNode, unsigned short p_RemoteEnd) throw (ChannelException)
 Open a socket to a given remote node/server address with remote port. More...

void Close ()
 Close all open sockets and clean up. More...

const Channel& operator>> (std::string &msg)
 Read from a open socket and store read message in msg. More...

const Channel& operator<< (const std::string &msg)
 Write a given message (msg) to the end-point using the open socket. More...

const std::string& GetLastError ()
 Return last error (if any). More...

void SetTransportHandler (Transport *transport)
 Set the SOAP transport handler. More...


Private Methods

bool Init ()
 OS specific initilization. More...

void Error (const char *err)
 Report error on read/write. More...

void CloseChannel ()
 Close & clean-up the open socket/system resources. More...


Private Attributes

unsigned int m_Sock
 Socket descriptor. More...

std::string m_RemoteNode
 Remote address could be IP/host-name. More...

unsigned short m_RemoteEnd
 Remote port number. More...

std::string m_LastErr
 Last error as a string. More...

Transportm_pTransportHandler
 Transport handler for validation purpose. More...


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.

Definition at line 144 of file Channel.hpp.


Constructor & Destructor Documentation

Channel::Channel ( )
 

Create a Channel & initialize

Definition at line 77 of file Channel.cpp.

Channel::~Channel ( )
 

Definition at line 82 of file Channel.cpp.


Member Function Documentation

void Channel::Close ( ) [inline]
 

Close all open sockets and clean up.

Definition at line 154 of file Channel.hpp.

void Channel::CloseChannel ( ) [private]
 

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

Close, and clean-up any OS specific stuff

Definition at line 279 of file Channel.cpp.

Referenced by Close(), Init(), operator<<(), operator>>(), and ~Channel().

void Channel::Error ( const char * err ) [private]
 

Report error on read/write.

Log any errors that cause on channel usage/initilaization

Definition at line 302 of file Channel.cpp.

Referenced by Init(), operator<<(), and operator>>().

const std::string & Channel::GetLastError ( ) [inline]
 

Return last error (if any).

Definition at line 163 of file Channel.hpp.

bool Channel::Init ( ) [private]
 

OS specific initilization.

OS specific initialization should do here

Returns:
true if successfuly initilaize OS specific stuffs. false o/w

Definition at line 167 of file Channel.cpp.

bool Channel::Open ( std::string & p_RemoteNode,
unsigned short p_RemoteEnd ) throw (ChannelException)
 

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. ????

Parameters:
p_RemoteNode   End point address as hostname/IP
p_RemoteEnd   Port #

Returns:
true if successfuly open a soket to the endpoint. o/w exception is thrown

Definition at line 98 of file Channel.cpp.

void Channel::SetTransportHandler ( Transport * transport ) [inline]
 

Set the SOAP transport handler.

Definition at line 166 of file Channel.hpp.

const Channel & Channel::operator<< ( const std::string & msg )
 

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.

Parameters:
Message   to be written to the open channel

Definition at line 210 of file Channel.cpp.

const Channel & Channel::operator>> ( std::string & msg )
 

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.

Parameters:
string   to hold the read Message

Definition at line 236 of file Channel.cpp.


Member Data Documentation

std::string Channel::m_LastErr [private]
 

Last error as a string.

Definition at line 181 of file Channel.hpp.

unsigned short Channel::m_RemoteEnd [private]
 

Remote port number.

Definition at line 180 of file Channel.hpp.

std::string Channel::m_RemoteNode [private]
 

Remote address could be IP/host-name.

Definition at line 179 of file Channel.hpp.

unsigned int Channel::m_Sock [private]
 

Socket descriptor.

Definition at line 178 of file Channel.hpp.

Transport * Channel::m_pTransportHandler [private]
 

Transport handler for validation purpose.

Definition at line 183 of file Channel.hpp.


The documentation for this class was generated from the following files: Axis C++ Client Lib - User's Guide

Copyright © 2001 SL_OpenSource XML Project. All Rights Reserved