UDK 3.2.7 C/C++ API Reference
|
The class should be understood as a reference to a socket address handle ( struct sockaddr ). More...
#include <socket_decl.hxx>
Public Member Functions | |
SocketAddr () | |
Creates socket address of unknown type. | |
SocketAddr (const SocketAddr &Addr) | |
Copy constructor. | |
SocketAddr (const oslSocketAddr, __osl_socket_NoCopy nocopy) | |
The SocketAddr takes over the responsibility of the handle ( which means, that the handle gets destructed by the destructor of this reference) | |
SocketAddr (oslSocketAddr Addr) | |
Copyconstructs the oslSocketAddr handle. | |
SocketAddr (const ::rtl::OUString &strAddrOrHostName, sal_Int32 nPort) | |
tcpip-specif constructor. | |
~SocketAddr () | |
destroys underlying oslSocketAddress | |
sal_Bool | is () const |
checks, if the SocketAddr was created successful. | |
inline::rtl::OUString | getHostname (oslSocketResult *pResult=0) const |
Converts the address to a (human readable) domain-name. | |
sal_Bool | setHostname (const ::rtl::OUString &sDottedIpOrHostname) |
Sets the ipaddress or hostname of the SocketAddress. | |
sal_Int32 | getPort () const |
Returns the port number of the address. | |
sal_Bool | setPort (sal_Int32 nPort) |
Sets the port number of the address. | |
sal_Bool | setAddr (const ::rtl::ByteSequence &address) |
Sets the address of the underlying socket address struct in network byte order. | |
inline::rtl::ByteSequence | getAddr (oslSocketResult *pResult=0) const |
Returns the address of the underlying socket in network byte order. | |
SocketAddr & | operator= (oslSocketAddr Addr) |
assign the handle to this reference. | |
SocketAddr & | operator= (const SocketAddr &Addr) |
SocketAddr & | assign (oslSocketAddr Addr, __osl_socket_NoCopy nocopy) |
Assigns the socket addr without copyconstructing it. | |
sal_Bool | operator== (oslSocketAddr Addr) const |
Returns true if the underlying handle is identical to the Addr handle. | |
sal_Bool | operator== (const SocketAddr &Addr) const |
Returns true if the underlying handle is identical to the Addr handle. | |
oslSocketAddr | getHandle () const |
Returns the underlying SocketAddr handle without copyconstructing it. | |
Static Public Member Functions | |
static inline::rtl::OUString | getLocalHostname (oslSocketResult *pResult=0) |
Get the hostname for the local interface. | |
static void | resolveHostname (const ::rtl::OUString &strHostName, SocketAddr &Addr) |
Tries to find an address for a host. | |
static sal_Int32 | getServicePort (const ::rtl::OUString &strServiceName, const ::rtl::OUString &strProtocolName=::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tcp"))) |
Tries to find the port associated with the given service/protocol- pair (e.g. | |
Protected Attributes | |
oslSocketAddr | m_handle |
The class should be understood as a reference to a socket address handle ( struct sockaddr ).
The handle is mutable.
osl::SocketAddr::SocketAddr | ( | ) | [inline] |
Creates socket address of unknown type.
osl::SocketAddr::SocketAddr | ( | const SocketAddr & | Addr | ) | [inline] |
Copy constructor.
osl::SocketAddr::SocketAddr | ( | const oslSocketAddr | Addr, |
__osl_socket_NoCopy | nocopy | ||
) | [inline] |
The SocketAddr takes over the responsibility of the handle ( which means, that the handle gets destructed by the destructor of this reference)
nocopy | use SAL_NO_COPY |
osl::SocketAddr::SocketAddr | ( | oslSocketAddr | Addr | ) | [inline] |
Copyconstructs the oslSocketAddr handle.
osl::SocketAddr::SocketAddr | ( | const ::rtl::OUString & | strAddrOrHostName, |
sal_Int32 | nPort | ||
) | [inline] |
tcpip-specif constructor.
strAddrOrHostName | strAddrOrHostName hostname or dotted ip-number of the network interface, the socket shall be created on. |
nPort | tcp-ip port number |
osl::SocketAddr::~SocketAddr | ( | ) | [inline] |
destroys underlying oslSocketAddress
SocketAddr & osl::SocketAddr::assign | ( | oslSocketAddr | Addr, |
__osl_socket_NoCopy | nocopy | ||
) | [inline] |
Assigns the socket addr without copyconstructing it.
nocopy | use SAL_NO_COPY |
rtl::ByteSequence osl::SocketAddr::getAddr | ( | oslSocketResult * | pResult = 0 | ) | const [inline] |
Returns the address of the underlying socket in network byte order.
oslSocketAddr osl::SocketAddr::getHandle | ( | ) | const [inline] |
Returns the underlying SocketAddr handle without copyconstructing it.
rtl::OUString osl::SocketAddr::getHostname | ( | oslSocketResult * | pResult = 0 | ) | const [inline] |
Converts the address to a (human readable) domain-name.
pResult | 0, if you are not interested in errors, otherwise *pResult contains an error code on failure or osl_Socket_Ok on success |
rtl::OUString osl::SocketAddr::getLocalHostname | ( | oslSocketResult * | pResult = 0 | ) | [inline, static] |
Get the hostname for the local interface.
pResult | after the call *pResult contains osl_Socket_Ok on success or an error on failure. |
sal_Int32 osl::SocketAddr::getPort | ( | ) | const [inline] |
Returns the port number of the address.
sal_Int32 osl::SocketAddr::getServicePort | ( | const ::rtl::OUString & | strServiceName, |
const ::rtl::OUString & | strProtocolName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tcp")) |
||
) | [inline, static] |
Tries to find the port associated with the given service/protocol- pair (e.g.
"ftp"/"tcp").
OSL_INVALID_PORT
if no service/protocol pair could be found. sal_Bool osl::SocketAddr::is | ( | ) | const [inline] |
checks, if the SocketAddr was created successful.
sal_True
if there is a valid underlying handle, otherwise sal_False. SocketAddr & osl::SocketAddr::operator= | ( | const SocketAddr & | Addr | ) | [inline] |
SocketAddr & osl::SocketAddr::operator= | ( | oslSocketAddr | Addr | ) | [inline] |
assign the handle to this reference.
The previous handle is released.
sal_Bool osl::SocketAddr::operator== | ( | oslSocketAddr | Addr | ) | const [inline] |
Returns true if the underlying handle is identical to the Addr handle.
sal_Bool osl::SocketAddr::operator== | ( | const SocketAddr & | Addr | ) | const [inline] |
Returns true if the underlying handle is identical to the Addr handle.
void osl::SocketAddr::resolveHostname | ( | const ::rtl::OUString & | strHostName, |
SocketAddr & | Addr | ||
) | [inline, static] |
Tries to find an address for a host.
sal_Bool osl::SocketAddr::setAddr | ( | const ::rtl::ByteSequence & | address | ) | [inline] |
Sets the address of the underlying socket address struct in network byte order.
sal_Bool osl::SocketAddr::setHostname | ( | const ::rtl::OUString & | sDottedIpOrHostname | ) | [inline] |
Sets the ipaddress or hostname of the SocketAddress.
sal_Bool osl::SocketAddr::setPort | ( | sal_Int32 | nPort | ) | [inline] |
Sets the port number of the address.
oslSocketAddr osl::SocketAddr::m_handle [protected] |