#include <SocketAddress.h>
Inheritance diagram for SocketAddress::
Public Methods | |
SocketAddress () | |
Create a SocketAddress with IP address and port initialized to zero. More... | |
SocketAddress (IpAddress, unsigned short) | |
Create and initialize the SocketAddress with the given parameters. More... | |
SocketAddress (struct sockaddr_in *) | |
Create the object with a sockaddr_in structure. More... | |
SocketAddress (const SocketAddress &) | |
Copy constructor. More... | |
virtual | ~SocketAddress () |
void | setSocketAddress (struct sockaddr_in *) |
void | setSocketAddress (const IpAddress &, unsigned short) |
void | setIpAddress (const IpAddress &) |
void | setPort (unsigned short) |
void | setPort (const char *) |
void | setPort (string) |
sockaddr_in * | getSockAddrStruct () |
Return a pointer to the internal sockaddr_in structure. More... | |
OS_SPEC_SOCKLEN * | getSockAddrStructLen () |
unsigned short | getPort () |
IpAddress | getIpAddress () |
bool | isZero () |
Return false if the IP address or port is zero. More... | |
bool | read (std::istream &) |
Read in an IP address and port in the form "IP:port". More... | |
bool | read (const char *) |
Does the same thing as read(istream&), but with a char array as input. More... | |
bool | read (string) |
Does the same thing as read(istream&), but with a string as input. More... | |
virtual void | toStream (std::ostream &) |
Print "IP:port". More... | |
const char * | toCStr () |
Get a C string representation of the SocketAddress. More... | |
Static Private Methods | |
void | initSockAddr (struct sockaddr_in *sockAddr, unsigned int ipAddr, int port) |
Initialize a sockaddr_in structure. More... | |
Private Attributes | |
IpAddress | m_ipAddr |
unsigned short | m_port |
sockaddr_in | m_sockAddrStruct |
OS_SPEC_SOCKLEN | m_sockAddrStructLen |
char | m_cstr [MAX_IP_ADDR_STR+1+5] |
IP address + ":" + port. More... |
Definition at line 12 of file SocketAddress.h.
|
Create a SocketAddress with IP address and port initialized to zero.
Definition at line 12 of file SocketAddress.cpp. |
|
Create and initialize the SocketAddress with the given parameters.
Definition at line 22 of file SocketAddress.cpp. |
|
Create the object with a sockaddr_in structure.
Definition at line 32 of file SocketAddress.cpp. |
|
Copy constructor.
Definition at line 41 of file SocketAddress.cpp. |
|
Definition at line 52 of file SocketAddress.cpp. |
|
|
Definition at line 133 of file SocketAddress.cpp. Referenced by TcpConnection::connect(), NodeManagerCommand::displayNode(), ConnectionManagerCommand::displayNode(), UserConfiguration::generateNodeHtmlInterface(), SummaryScreenCommand::getHtmlInterface(), BasicConfigurationCommand::run(), ConnectionPacket::setSocketAddress(), ProxyCommandProcessor::toStream(), and HttpTestCommandProcessor::toStream().
|
|
Return a pointer to the internal sockaddr_in structure. If the struct is modified outside of this object, you must re-sync it with this object by calling setSocketAddress(struct sockaddr_in). Definition at line 121 of file SocketAddress.cpp. Referenced by TcpConnection::accept(), and TcpConnection::createListeningSocket().
|
|
Definition at line 127 of file SocketAddress.cpp. Referenced by TcpConnection::createListeningSocket().
|
|
Initialize a sockaddr_in structure.
Definition at line 63 of file SocketAddress.cpp. Referenced by setIpAddress(), and setPort().
|
|
Return false if the IP address or port is zero.
Definition at line 168 of file SocketAddress.cpp. |
|
Does the same thing as read(istream&), but with a string as input.
Definition at line 213 of file SocketAddress.cpp. |
|
Does the same thing as read(istream&), but with a char array as input.
Definition at line 203 of file SocketAddress.cpp. |
|
Read in an IP address and port in the form "IP:port". It is assumed that the read pointer is placed at the beginning of the IP address. When the function exits the read pointer will be at the end of port.
Definition at line 182 of file SocketAddress.cpp. Referenced by operator>>(), and read().
|
|
Definition at line 72 of file SocketAddress.cpp. Referenced by SocketAddress(), ConnectionPacket::getSocketAddress(), WebServer::getSocketAddressFromHttp(), and read().
|
|
Definition at line 110 of file SocketAddress.cpp. |
|
Definition at line 104 of file SocketAddress.cpp. |
|
Definition at line 94 of file SocketAddress.cpp. Referenced by SocketAddress(), ConnectionPacket::getSocketAddress(), WebServer::getSocketAddressFromHttp(), read(), and setPort().
|
|
|
|
Definition at line 82 of file SocketAddress.cpp. Referenced by SocketAddress(), and TcpConnection::accept().
|
|
Get a C string representation of the SocketAddress. You may NOT modify the memory returned. Definition at line 158 of file SocketAddress.cpp. Referenced by SocketAddress(), TcpConnection::accept(), LinkLayerInterface::connect(), TcpConnection::createListeningSocket(), WebServer::handleConnection(), read(), setIpAddress(), setPort(), and setSocketAddress().
|
|
Print "IP:port".
Reimplemented from BasicObject. Definition at line 148 of file SocketAddress.cpp. |
|
IP address + ":" + port.
Definition at line 50 of file SocketAddress.h. |
|
Definition at line 44 of file SocketAddress.h. |
|
Definition at line 45 of file SocketAddress.h. |
|
Definition at line 46 of file SocketAddress.h. |
|
Definition at line 47 of file SocketAddress.h. |