OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
Socket Class Referenceabstract

#include <Socket.h>

Inheritance diagram for Socket:
Inheritance graph
Collaboration diagram for Socket:
Collaboration graph

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 More...
 
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 ()
 
 Socket (int socket, struct sockaddr *addr)
 
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() [1/2]

Socket::Socket ( )
inline

Definition at line 54 of file Socket.h.

◆ Socket() [2/2]

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

Definition at line 53 of file Socket.cc.

References _ip, and _port.

◆ ~Socket()

virtual Socket::~Socket ( )
inlinevirtual

Definition at line 61 of file Socket.h.

References close(), and connect().

Here is the call graph for this function:

Member Function Documentation

◆ allowConnection()

virtual bool Socket::allowConnection ( )
pure virtual

Implemented in TcpSocket, and UnixSocket.

Referenced by getIp(), and PPTServer::initConnection().

◆ close()

void Socket::close ( )
virtual

◆ connect()

virtual void Socket::connect ( )
pure virtual

Implemented in TcpSocket, and UnixSocket.

Referenced by PPTClient::PPTClient(), and ~Socket().

◆ dump()

void Socket::dump ( 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

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 SocketListener::dump(), UnixSocket::dump(), TcpSocket::dump(), Connection::dump(), and getIp().

Here is the call graph for this function:

◆ getIp()

string Socket::getIp ( )
inline

Definition at line 78 of file Socket.h.

References _ip, allowConnection(), dump(), getRecvBufferSize(), getSendBufferSize(), and newSocket().

Referenced by BESServerHandler::handle().

Here is the call graph for this function:

◆ getPort()

unsigned int Socket::getPort ( )
inline

Definition at line 74 of file Socket.h.

References _port.

Referenced by BESServerHandler::handle().

◆ getRecvBufferSize()

virtual unsigned int Socket::getRecvBufferSize ( )
pure virtual

◆ getSendBufferSize()

virtual unsigned int Socket::getSendBufferSize ( )
pure virtual

Implemented in TcpSocket, and UnixSocket.

Referenced by getIp(), and PPTConnection::getSendChunkSize().

◆ getSocketDescriptor()

virtual int Socket::getSocketDescriptor ( )
inlinevirtual

◆ isConnected()

virtual bool Socket::isConnected ( )
inlinevirtual

Definition at line 63 of file Socket.h.

References _connected, and listen().

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

Here is the call graph for this function:

◆ isListening()

virtual bool Socket::isListening ( )
inlinevirtual

Definition at line 65 of file Socket.h.

References _listening, close(), receive(), send(), and sync().

Referenced by SocketListener::listen().

Here is the call graph for this function:

◆ listen()

virtual void Socket::listen ( )
pure virtual

Implemented in TcpSocket, and UnixSocket.

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

◆ newSocket()

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

Implemented in TcpSocket, and UnixSocket.

Referenced by SocketListener::accept(), and getIp().

◆ receive()

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

Definition at line 108 of file Socket.cc.

References _socket.

Referenced by PPTServer::closeConnection(), isListening(), and PPTConnection::send().

◆ send()

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

Definition at line 93 of file Socket.cc.

References _socket.

Referenced by isListening(), and PPTConnection::send().

◆ sync()

void Socket::sync ( )
virtual

Definition at line 124 of file Socket.cc.

References _socket.

Referenced by isListening(), and PPTConnection::send().

Member Data Documentation

◆ _addr_set

bool Socket::_addr_set
protected

Definition at line 52 of file Socket.h.

Referenced by dump().

◆ _connected

bool Socket::_connected
protected

◆ _ip

string Socket::_ip
protected

Definition at line 50 of file Socket.h.

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

◆ _listening

bool Socket::_listening
protected

◆ _port

unsigned int Socket::_port
protected

Definition at line 51 of file Socket.h.

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

◆ _socket


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