nidas v1.2.3
|
An interface for a socket address. More...
#include <SocketAddress.h>
Public Member Functions | |
virtual SocketAddress * | clone () const =0 |
Virtual constructor. | |
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. | |
virtual int | getPort () const =0 |
return the port number of this address, or -1 if there is no associated port number, e.g. | |
virtual struct sockaddr * | getSockAddrPtr ()=0 |
Provide non-const pointer to struct sockaddr_in. | |
virtual const struct sockaddr * | getConstSockAddrPtr () const =0 |
virtual socklen_t | getSockAddrLen () const =0 |
Return the length of the struct sockaddr_XX for this address family. | |
virtual std::string | toString () const =0 |
Java style toString. | |
virtual std::string | toAddressString () const =0 |
Java style toString, but no DNS lookup. | |
An interface for a socket address.
|
inlinevirtual |
|
pure virtual |
Virtual constructor.
Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.
Referenced by nidas::util::DatagramPacketBase::operator=(), nidas::util::SocketImpl::operator=(), nidas::core::DSMConfig::setDerivedDataSocketAddr(), nidas::util::DatagramPacketBase::setSocketAddress(), nidas::core::DSMConfig::setStatusSocketAddr(), nidas::core::DSMServer::setStatusSocketAddr(), and nidas::util::SocketImpl::SocketImpl().
|
pure virtual |
Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.
Referenced by nidas::util::SocketImpl::connect(), and nidas::util::DatagramPacketBase::getConstSockAddrPtr().
|
pure virtual |
Get the family of this SocketAddress, one of the values from /usr/include/sys/socket.h: AF_UNIX, AF_INET, AF_INET6, etc.
Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.
|
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(), and nidas::util::SocketImpl::getRemotePort().
|
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::SocketImpl::connect(), and nidas::util::DatagramPacketBase::getSockAddrLen().
|
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().
|
pure virtual |
Java style toString, but no DNS lookup.
Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.
Referenced by nidas::util::SocketImpl::accept(), nidas::util::SocketImpl::connect(), nidas::util::SocketImpl::getBroadcastEnable(), nidas::util::SocketImpl::getInQueueSize(), nidas::util::SocketImpl::getInterface(), nidas::util::SocketImpl::getKeepAlive(), nidas::util::SocketImpl::getKeepAliveIdleSecs(), nidas::util::SocketImpl::getMulticastLoop(), nidas::util::SocketImpl::getOutQueueSize(), nidas::util::SocketImpl::getReceiveBufferSize(), nidas::util::SocketImpl::getSendBufferSize(), nidas::util::SocketImpl::getTcpNoDelay(), nidas::util::SocketImpl::getTimeToLive(), nidas::util::SocketImpl::isNonBlocking(), nidas::util::SocketImpl::listen(), nidas::util::SocketImpl::receive(), nidas::util::SocketImpl::receive(), nidas::util::SocketImpl::recv(), nidas::util::SocketImpl::recvfrom(), nidas::util::SocketImpl::send(), nidas::util::SocketImpl::send(), nidas::util::SocketImpl::sendall(), nidas::util::SocketImpl::sendto(), nidas::util::SocketImpl::setBroadcastEnable(), nidas::util::SocketImpl::setInterface(), nidas::util::SocketImpl::setInterface(), nidas::util::SocketImpl::setKeepAlive(), nidas::util::SocketImpl::setKeepAliveIdleSecs(), nidas::util::SocketImpl::setMulticastLoop(), nidas::util::SocketImpl::setNonBlocking(), nidas::util::SocketImpl::setPktInfo(), nidas::util::SocketImpl::setReceiveBufferSize(), nidas::util::SocketImpl::setSendBufferSize(), nidas::util::SocketImpl::setTcpNoDelay(), and nidas::util::SocketImpl::setTimeToLive().
|
pure virtual |
Java style toString.
Implemented in nidas::util::Inet4SocketAddress, and nidas::util::UnixSocketAddress.