OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
TcpSocket Class Reference

#include <TcpSocket.h>

Inheritance diagram for TcpSocket:
Inheritance graph
Collaboration diagram for TcpSocket:
Collaboration graph

Public Member Functions

virtual bool allowConnection ()
 is there any wrapper code for unix sockets More...
 
virtual void close ()
 
virtual void connect ()
 
virtual void dump (std::ostream &strm) const
 dumps information about this object More...
 
std::string getIp ()
 
unsigned int getPort ()
 
virtual unsigned int getRecvBufferSize ()
 get the tcp receive buffer size using getsockopt More...
 
virtual unsigned int getSendBufferSize ()
 get the tcp send buffer size using getsockopt More...
 
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 std::string &str, int start, int end)
 
 TcpSocket (const std::string &host, int portVal)
 
 TcpSocket (int portVal)
 
 TcpSocket (int socket, struct sockaddr *addr)
 
virtual ~TcpSocket ()
 

Protected Attributes

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

Detailed Description

Definition at line 40 of file TcpSocket.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file TcpSocket.h.

Referenced by newSocket().

TcpSocket::TcpSocket ( int  portVal)
inline

Definition at line 57 of file TcpSocket.h.

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

Definition at line 62 of file TcpSocket.h.

virtual TcpSocket::~TcpSocket ( )
inlinevirtual

Definition at line 67 of file TcpSocket.h.

Member Function Documentation

bool TcpSocket::allowConnection ( )
virtual

is there any wrapper code for unix sockets

Implements Socket.

Definition at line 559 of file TcpSocket.cc.

References Socket::getSocketDescriptor().

Here is the call graph for this function:

void TcpSocket::connect ( )
virtual

Implements Socket.

Definition at line 73 of file TcpSocket.cc.

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

void TcpSocket::dump ( std::ostream &  strm) const
virtual

dumps information about this object

Displays the pointer value of this instance

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from Socket.

Definition at line 584 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:

std::string Socket::getIp ( )
inlineinherited

Definition at line 86 of file Socket.h.

References Socket::_ip.

Referenced by SocketListener::accept(), and DaemonCommandHandler::handle().

unsigned int Socket::getPort ( )
inlineinherited

Definition at line 82 of file Socket.h.

References Socket::_port.

Referenced by SocketListener::accept(), and DaemonCommandHandler::handle().

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
BESInternalFatalErrorif we are unable to get the size of the receive buffer

Implements Socket.

Definition at line 494 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
BESInternalFatalErrorif we are unable to get the size of the send buffer

Implements Socket.

Definition at line 529 of file TcpSocket.cc.

References Socket::_socket, and BESDEBUG.

virtual int Socket::getSocketDescriptor ( )
inlinevirtualinherited
virtual bool Socket::isConnected ( )
inlinevirtualinherited

Definition at line 61 of file Socket.h.

References Socket::_connected.

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

virtual bool Socket::isListening ( )
inlinevirtualinherited

Definition at line 66 of file Socket.h.

References Socket::_listening.

Referenced by SocketListener::listen().

void TcpSocket::listen ( )
virtual

Implements Socket.

Definition at line 255 of file TcpSocket.cc.

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

virtual Socket* TcpSocket::newSocket ( int  socket,
struct sockaddr *  addr 
)
inlinevirtual

Implements Socket.

Definition at line 76 of file TcpSocket.h.

References TcpSocket().

Here is the call graph for this function:

int Socket::receive ( char *  inBuff,
const int  inSize 
)
virtualinherited

Definition at line 98 of file Socket.cc.

References Socket::_socket, and BESLog::TheLog().

Referenced by PPTConnection::readBuffer().

Here is the call graph for this function:

void Socket::send ( const std::string &  str,
int  start,
int  end 
)
virtualinherited

Definition at line 86 of file Socket.cc.

References Socket::_socket.

Referenced by PPTConnection::send().

Member Data Documentation

bool Socket::_addr_set
protectedinherited

Definition at line 49 of file Socket.h.

Referenced by Socket::dump().

bool Socket::_connected
protectedinherited
std::string Socket::_ip
protectedinherited

Definition at line 47 of file Socket.h.

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

bool Socket::_listening
protectedinherited
unsigned int Socket::_port
protectedinherited

Definition at line 48 of file Socket.h.

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


The documentation for this class was generated from the following files: