nidas  v1.2-1520
Public Member Functions | List of all members
nidas::util::SocketAddress Class Referenceabstract

An interface for a socket address. More...

#include <SocketAddress.h>

Inheritance diagram for nidas::util::SocketAddress:
Inheritance graph
[legend]

Public Member Functions

virtual SocketAddressclone () const =0
 Virtual constructor. More...
 
virtual ~SocketAddress ()
 
virtual int getFamily () const =0
 Get the family of this SocketAddress, one of the values from /usr/include/sys/socket.h: AF_UNIX, AF_INET, AF_INET6, etc. More...
 
virtual int getPort () const =0
 return the port number of this address, or -1 if there is no associated port number, e.g. More...
 
virtual struct sockaddr * getSockAddrPtr ()=0
 Provide non-const pointer to struct sockaddr_in. More...
 
virtual struct sockaddr * getConstSockAddrPtr () const =0
 
virtual socklen_t getSockAddrLen () const =0
 Return the length of the struct sockaddr_XX for this address family. More...
 
virtual std::string toString () const =0
 Java style toString. More...
 
virtual std::string toAddressString () const =0
 Java style toString, but no DNS lookup. More...
 

Detailed Description

An interface for a socket address.

Constructor & Destructor Documentation

virtual nidas::util::SocketAddress::~SocketAddress ( )
inlinevirtual

Member Function Documentation

virtual SocketAddress* nidas::util::SocketAddress::clone ( ) const
pure virtual
virtual struct sockaddr* nidas::util::SocketAddress::getConstSockAddrPtr ( ) const
pure virtual
virtual int nidas::util::SocketAddress::getFamily ( ) const
pure virtual
virtual int nidas::util::SocketAddress::getPort ( ) const
pure virtual

return the port number of this address, or -1 if there is no associated port number, e.g.

AF_UNIX.

Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.

Referenced by nidas::util::SocketImpl::getLocalPort(), nidas::util::SocketImpl::getRemotePort(), nidas::core::DSMServerApp::run(), and nidas::core::DSMEngine::run().

virtual socklen_t nidas::util::SocketAddress::getSockAddrLen ( ) const
pure virtual

Return the length of the struct sockaddr_XX for this address family.

Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.

Referenced by nidas::util::DatagramPacketBase::getSockAddrLen().

virtual struct sockaddr* nidas::util::SocketAddress::getSockAddrPtr ( )
pure virtual

Provide non-const pointer to struct sockaddr_in.

This is needed for recvfrom methods. recvfrom updates the struct sockaddr, so we can't cache the other portions of the address.

Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.

Referenced by nidas::util::DatagramPacketBase::getSockAddrPtr().

virtual std::string nidas::util::SocketAddress::toAddressString ( ) const
pure virtual
virtual std::string nidas::util::SocketAddress::toString ( ) const
pure virtual

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