bes Updated for version 3.20.13
TcpSocket Class Reference
Collaboration diagram for TcpSocket:
Collaboration graph

Public Member Functions

virtual bool allowConnection ()
 is there any wrapper code for unix sockets
 
virtual void close ()
 
virtual void connect ()
 
virtual void dump (std::ostream &strm) const
 dumps information about this object
 
std::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 std::string &str, int start, int end)
 
 TcpSocket (const std::string &host, int portVal)
 
 TcpSocket (int portVal)
 
 TcpSocket (int socket, struct sockaddr *addr)
 

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() [1/3]

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

Build a TcPSocket object.

Parameters
hostA DNS name or an IPV4 number
portValThe port to listen on

Definition at line 57 of file TcpSocket.h.

◆ TcpSocket() [2/3]

TcpSocket::TcpSocket ( int  portVal)
inline

Definition at line 62 of file TcpSocket.h.

◆ TcpSocket() [3/3]

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

Definition at line 67 of file TcpSocket.h.

◆ ~TcpSocket()

virtual TcpSocket::~TcpSocket ( )
inlinevirtual

Definition at line 72 of file TcpSocket.h.

Member Function Documentation

◆ allowConnection()

bool TcpSocket::allowConnection ( )
virtual

is there any wrapper code for unix sockets

Implements Socket.

Definition at line 563 of file TcpSocket.cc.

◆ close()

void Socket::close ( )
virtualinherited

Definition at line 79 of file Socket.cc.

◆ connect()

void TcpSocket::connect ( )
virtual

Implements Socket.

Definition at line 75 of file TcpSocket.cc.

◆ dump()

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 588 of file TcpSocket.cc.

◆ getIp()

std::string Socket::getIp ( )
inlineinherited

Definition at line 89 of file Socket.h.

◆ getPort()

unsigned int Socket::getPort ( )
inlineinherited

Definition at line 85 of file Socket.h.

◆ getRecvBufferSize()

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 500 of file TcpSocket.cc.

◆ getSendBufferSize()

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 534 of file TcpSocket.cc.

◆ getSocketDescriptor()

virtual int Socket::getSocketDescriptor ( )
inlinevirtualinherited

Definition at line 81 of file Socket.h.

◆ isConnected()

virtual bool Socket::isConnected ( )
inlinevirtualinherited

Definition at line 64 of file Socket.h.

◆ isListening()

virtual bool Socket::isListening ( )
inlinevirtualinherited

Definition at line 69 of file Socket.h.

◆ listen()

void TcpSocket::listen ( )
virtual

Implements Socket.

Definition at line 259 of file TcpSocket.cc.

◆ newSocket()

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

Implements Socket.

Definition at line 81 of file TcpSocket.h.

◆ receive()

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

Definition at line 101 of file Socket.cc.

◆ send()

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

Definition at line 89 of file Socket.cc.

Member Data Documentation

◆ _addr_set

bool Socket::_addr_set
protectedinherited

Definition at line 49 of file Socket.h.

◆ _connected

bool Socket::_connected
protectedinherited

Definition at line 45 of file Socket.h.

◆ _ip

std::string Socket::_ip
protectedinherited

Definition at line 47 of file Socket.h.

◆ _listening

bool Socket::_listening
protectedinherited

Definition at line 46 of file Socket.h.

◆ _port

unsigned int Socket::_port
protectedinherited

Definition at line 48 of file Socket.h.

◆ _socket

int Socket::_socket
protectedinherited

Definition at line 44 of file Socket.h.


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