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

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

Protected Attributes

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

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 53 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 bool Socket::allowConnection (  )  [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTServer::initConnection().

void Socket::close (  )  [virtual]

Reimplemented in UnixSocket.

Definition at line 81 of file Socket.cc.

References _connected, _listening, and _socket.

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

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

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTClient::PPTClient().

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 136 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(), and Connection::dump().

Here is the call graph for this function:

string Socket::getIp (  )  [inline]

Definition at line 78 of file Socket.h.

References _ip.

unsigned int Socket::getPort (  )  [inline]

Definition at line 74 of file Socket.h.

References _port.

virtual unsigned int Socket::getRecvBufferSize (  )  [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTConnection::getRecvChunkSize(), and PPTConnection::receive().

virtual unsigned int Socket::getSendBufferSize (  )  [pure virtual]

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTConnection::getSendChunkSize().

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

Definition at line 70 of file Socket.h.

References _socket.

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

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 bool Socket::isListening (  )  [inline, virtual]

Definition at line 65 of file Socket.h.

References _listening.

Referenced by SocketListener::listen().

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

Implemented in TcpSocket, and UnixSocket.

Referenced by SocketListener::listen().

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

Implemented in TcpSocket, and UnixSocket.

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

Definition at line 108 of file Socket.cc.

References _socket.

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

Definition at line 93 of file Socket.cc.

References _socket.

Referenced by PPTConnection::send().

void Socket::sync (  )  [virtual]

Definition at line 124 of file Socket.cc.

References _socket.

Referenced by PPTConnection::send().


Member Data Documentation

bool Socket::_addr_set [protected]

Definition at line 52 of file Socket.h.

Referenced by dump().

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().

string Socket::_ip [protected]

Definition at line 50 of file Socket.h.

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

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().

unsigned int Socket::_port [protected]

Definition at line 51 of file Socket.h.

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

int Socket::_socket [protected]

Definition at line 47 of file Socket.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Feb 11 09:18:25 2010 for OPeNDAP Hyrax Back End Server (BES) by  doxygen 1.4.7