Socket Class Reference

#include <Socket.h>

Inheritance diagram for Socket:

Inheritance graph
[legend]
Collaboration diagram for Socket:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Socket ()
 Socket (int socket, struct sockaddr *addr)
virtual ~Socket ()
virtual void connect ()=0
virtual bool isConnected ()
virtual void listen ()=0
virtual bool isListening ()
virtual void close ()
virtual void send (const string &str, int start, int end)
virtual int receive (char *inBuff, int inSize)
virtual int getSocketDescriptor ()
unsigned int getPort ()
string getIp ()
virtual SocketnewSocket (int socket, struct sockaddr *addr)=0
virtual void dump (ostream &strm) const
 dumps information about this object

Protected Attributes

int _socket
bool _connected
bool _listening
string _ip
unsigned int _port
bool _addr_set


Detailed Description

Definition at line 44 of file Socket.h.


Constructor & Destructor Documentation

Socket::Socket (  )  [inline]

Definition at line 54 of file Socket.h.

Socket::Socket ( int  socket,
struct sockaddr *  addr 
)

Definition at line 42 of file Socket.cc.

References _ip, and _port.

virtual Socket::~Socket (  )  [inline, virtual]

Definition at line 61 of file Socket.h.

References close().

Here is the call graph for this function:


Member Function Documentation

virtual void Socket::connect (  )  [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTClient::PPTClient().

virtual bool Socket::isConnected (  )  [inline, virtual]

Definition at line 63 of file Socket.h.

References _connected.

Referenced by Connection::isConnected(), SocketListener::listen(), and PPTClient::PPTClient().

virtual void Socket::listen (  )  [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by SocketListener::listen().

virtual bool Socket::isListening (  )  [inline, virtual]

Definition at line 65 of file Socket.h.

References _listening.

Referenced by SocketListener::listen().

void Socket::close (  )  [virtual]

Reimplemented in UnixSocket.

Definition at line 70 of file Socket.cc.

References _connected, _listening, and _socket.

Referenced by UnixSocket::close(), PPTServer::closeConnection(), PPTClient::closeConnection(), ServerApp::terminate(), and ~Socket().

void Socket::send ( const string &  str,
int  start,
int  end 
) [virtual]

Definition at line 82 of file Socket.cc.

References _socket.

Referenced by PPTConnection::writeBuffer().

int Socket::receive ( char *  inBuff,
int  inSize 
) [virtual]

Definition at line 97 of file Socket.cc.

References _socket.

Referenced by PPTConnection::readBuffer().

virtual int Socket::getSocketDescriptor (  )  [inline, virtual]

Definition at line 69 of file Socket.h.

References _socket.

Referenced by SocketListener::accept(), SocketListener::listen(), and PPTConnection::readBufferNonBlocking().

unsigned int Socket::getPort (  )  [inline]

Definition at line 73 of file Socket.h.

References _port.

string Socket::getIp (  )  [inline]

Definition at line 77 of file Socket.h.

References _ip.

virtual Socket* Socket::newSocket ( int  socket,
struct sockaddr *  addr 
) [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by SocketListener::accept().

void Socket::dump ( ostream &  strm  )  const [virtual]

dumps information about this object

Displays the pointer value of this instance

Parameters:
strm C++ i/o stream to dump the information to

Implements BESObj.

Reimplemented in TcpSocket, and UnixSocket.

Definition at line 119 of file Socket.cc.

References _addr_set, _connected, _ip, _listening, _port, _socket, BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Referenced by UnixSocket::dump(), TcpSocket::dump(), SocketListener::dump(), and Connection::dump().

Here is the call graph for this function:


Member Data Documentation

int Socket::_socket [protected]

Definition at line 47 of file Socket.h.

Referenced by close(), UnixSocket::connect(), TcpSocket::connect(), dump(), getSocketDescriptor(), UnixSocket::listen(), TcpSocket::listen(), receive(), and send().

bool Socket::_connected [protected]

Definition at line 48 of file Socket.h.

Referenced by UnixSocket::close(), close(), UnixSocket::connect(), TcpSocket::connect(), dump(), isConnected(), UnixSocket::listen(), and TcpSocket::listen().

bool Socket::_listening [protected]

Definition at line 49 of file Socket.h.

Referenced by UnixSocket::close(), close(), UnixSocket::connect(), TcpSocket::connect(), dump(), isListening(), UnixSocket::listen(), and TcpSocket::listen().

string Socket::_ip [protected]

Definition at line 50 of file Socket.h.

Referenced by dump(), getIp(), and Socket().

unsigned int Socket::_port [protected]

Definition at line 51 of file Socket.h.

Referenced by dump(), getPort(), and Socket().

bool Socket::_addr_set [protected]

Definition at line 52 of file Socket.h.

Referenced by dump().


The documentation for this class was generated from the following files:
Generated on Sat Jan 19 04:16:38 2008 for OPeNDAP Back End Server (BES) by  doxygen 1.5.4