TcpSocket Class Reference

#include <TcpSocket.h>

Inheritance diagram for TcpSocket:

Inheritance graph
[legend]
Collaboration diagram for TcpSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual bool allowConnection ()
 is there any wrapper code for unix sockets
virtual void close ()
virtual void connect ()
virtual void dump (ostream &strm) const
 dumps information about this object
string getIp ()
unsigned int getPort ()
virtual unsigned int getRecvBufferSize ()
 get the tcp receive buffer size using getsockopt
virtual unsigned int getSendBufferSize ()
 get the tcp send buffer size using getsockopt
virtual int getSocketDescriptor ()
virtual bool isConnected ()
virtual bool isListening ()
virtual void listen ()
virtual SocketnewSocket (int socket, struct sockaddr *addr)
virtual int receive (char *inBuff, const int inSize)
virtual void send (const string &str, int start, int end)
virtual void sync ()
 TcpSocket (int socket, struct sockaddr *addr)
 TcpSocket (int portVal)
 TcpSocket (const string &host, int portVal)
virtual ~TcpSocket ()

Protected Attributes

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

Detailed Description

Definition at line 42 of file TcpSocket.h.


Constructor & Destructor Documentation

TcpSocket::TcpSocket ( const string &  host,
int  portVal 
) [inline]

Definition at line 55 of file TcpSocket.h.

Referenced by newSocket().

TcpSocket::TcpSocket ( int  portVal  )  [inline]

Definition at line 63 of file TcpSocket.h.

TcpSocket::TcpSocket ( int  socket,
struct sockaddr *  addr 
) [inline]

Definition at line 71 of file TcpSocket.h.

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

Definition at line 80 of file TcpSocket.h.


Member Function Documentation

bool TcpSocket::allowConnection (  )  [virtual]

is there any wrapper code for unix sockets

Implements Socket.

Definition at line 609 of file TcpSocket.cc.

References Socket::getSocketDescriptor().

Here is the call graph for this function:

void Socket::close (  )  [virtual, inherited]

Reimplemented in UnixSocket.

Definition at line 81 of file Socket.cc.

References Socket::_connected, Socket::_listening, and Socket::_socket.

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

void TcpSocket::connect (  )  [virtual]

Implements Socket.

Definition at line 68 of file TcpSocket.cc.

References Socket::_connected, Socket::_listening, and Socket::_socket.

void TcpSocket::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

Reimplemented from Socket.

Definition at line 635 of file TcpSocket.cc.

References Socket::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Referenced by ServerApp::dump().

Here is the call graph for this function:

string Socket::getIp (  )  [inline, inherited]

Definition at line 78 of file Socket.h.

References Socket::_ip.

unsigned int Socket::getPort (  )  [inline, inherited]

Definition at line 74 of file Socket.h.

References Socket::_port.

unsigned int TcpSocket::getRecvBufferSize (  )  [virtual]

get the tcp receive buffer size using getsockopt

Get the receive buffer size for this socket descriptor using the getsockopt system function. We do this to maximize the performance of TCP sockets

Exceptions:
BESInternalFatalError if we are unable to get the size of the receive buffer

Implements Socket.

Definition at line 536 of file TcpSocket.cc.

References Socket::_socket, and BESDEBUG.

unsigned int TcpSocket::getSendBufferSize (  )  [virtual]

get the tcp send buffer size using getsockopt

Get the send buffer size for this socket descriptor using the getsockopt system function. We do this to maximize the performance of TCP sockets

Exceptions:
BESInternalFatalError if we are unable to get the size of the send buffer

Implements Socket.

Definition at line 575 of file TcpSocket.cc.

References Socket::_socket, and BESDEBUG.

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

Definition at line 70 of file Socket.h.

References Socket::_socket.

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

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

Definition at line 63 of file Socket.h.

References Socket::_connected.

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

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

Definition at line 65 of file Socket.h.

References Socket::_listening.

Referenced by SocketListener::listen().

void TcpSocket::listen (  )  [virtual]

Implements Socket.

Definition at line 285 of file TcpSocket.cc.

References Socket::_connected, Socket::_listening, and Socket::_socket.

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

Implements Socket.

Definition at line 87 of file TcpSocket.h.

References TcpSocket().

Here is the call graph for this function:

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

Definition at line 108 of file Socket.cc.

References Socket::_socket.

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

Definition at line 93 of file Socket.cc.

References Socket::_socket.

Referenced by PPTConnection::send().

void Socket::sync (  )  [virtual, inherited]

Definition at line 124 of file Socket.cc.

References Socket::_socket.

Referenced by PPTConnection::send().


Member Data Documentation

bool Socket::_addr_set [protected, inherited]

Definition at line 52 of file Socket.h.

Referenced by Socket::dump().

bool Socket::_connected [protected, inherited]

Definition at line 48 of file Socket.h.

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

string Socket::_ip [protected, inherited]

Definition at line 50 of file Socket.h.

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

bool Socket::_listening [protected, inherited]

Definition at line 49 of file Socket.h.

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

unsigned int Socket::_port [protected, inherited]

Definition at line 51 of file Socket.h.

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

int Socket::_socket [protected, inherited]

Definition at line 47 of file Socket.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Sep 16 15:25:27 2010 for OPeNDAP Hyrax Back End Server (BES) by  doxygen 1.4.7