Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


Methods of Class SocketAddr


SocketAddr
SocketAddr();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Creates socket address of unknown type.

SocketAddr
SocketAddr(
const SocketAddr & Addr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Copy constructor.

SocketAddr
SocketAddr(
const oslSocketAddr ,
__osl_socket_NoCopy nocopy );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
The SocketAddr takes over the responsibility of the handle ( which means, that the handle gets destructed by the destructor of this reference)
Parameters
nocopy
use SAL_NO_COPY

SocketAddr
SocketAddr(
oslSocketAddr Addr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Copyconstructs the oslSocketAddr handle.

SocketAddr
SocketAddr(
const ::rtl::OUString & strAddrOrHostName,
sal_Int32 nPort );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
tcpip-specif constructor.
Parameters
strAddrOrHostName
strAddrOrHostName hostname or dotted ip-number of the network
                         interface, the socket shall be created on.
nPort
tcp-ip port number

~SocketAddr
~SocketAddr();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
destroys underlying oslSocketAddress

is
sal_Bool is();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
checks, if the SocketAddr was created successful.
Return
sal_True if there is a valid underlying handle, otherwise sal_False.

getHostname
::rtl::OUString getHostname(
oslSocketResult * pResult = 0 ) const;

virtual abstract const volatile template static inline C-linkage
NO NO YES NO NO NO YES NO

Summary
Converts the address to a (human readable) domain-name.
Parameters
pResult
0, if you are not interested in errors,
                           otherwise *pResult contains an error code on failure
                           or osl_Socket_Ok on success
            
Return
the hostname of this SocketAddr or an empty string on failure.
See Also
osl_getHostnameOfSocketAddr()

setHostname
sal_Bool setHostname(
const ::rtl::OUString & sDottedIpOrHostname );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Sets the ipaddress or hostname of the SocketAddress

getPort
sal_Int32 getPort();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Returns the port number of the address.
Return
the port in host-byte order or or OSL_INVALID_PORT on errors.

setPort
sal_Bool setPort(
sal_Int32 nPort );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Sets the port number of the address.
Return
true if successfule.

setAddr
sal_Bool setAddr(
const ::rtl::ByteSequence & address );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Sets the address of the underlying socket address struct in network byte order.
Return
true on success, false signales falure.

getAddr
::rtl::ByteSequence getAddr(
oslSocketResult * pResult = 0 ) const;

virtual abstract const volatile template static inline C-linkage
NO NO YES NO NO NO YES NO

Summary
Returns the address of the underlying socket in network byte order

operator=
SocketAddr & operator=(
oslSocketAddr Addr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
assign the handle to this reference. The previous handle is released.

operator=
SocketAddr & operator=(
const SocketAddr & Addr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO


assign
SocketAddr & assign(
oslSocketAddr Addr,
__osl_socket_NoCopy nocopy );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Assigns the socket addr without copyconstructing it.
Parameters
nocopy
use SAL_NO_COPY

operator==
sal_Bool operator==(
oslSocketAddr Addr ) const;

virtual abstract const volatile template static inline C-linkage
NO NO YES NO NO NO YES NO

Summary
Returns true if the underlying handle is identical to the Addr handle.

operator==
sal_Bool operator==(
const SocketAddr & Addr ) const;

virtual abstract const volatile template static inline C-linkage
NO NO YES NO NO NO YES NO

Summary
Returns true if the underlying handle is identical to the Addr handle.

getHandle
oslSocketAddr getHandle();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO YES NO

Summary
Returns the underlying SocketAddr handle without copyconstructing it.

getLocalHostname
static ::rtl::OUString getLocalHostname(
oslSocketResult * pResult = 0 );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO YES YES NO

Summary
Get the hostname for the local interface.
Parameters
after
the call *pResult contains osl_Socket_Ok on success or
       an error on failure. 
Return
the hostname

resolveHostname
static void resolveHostname(
const ::rtl::OUString & strHostName,
SocketAddr & Addr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO YES YES NO

Summary
Tries to find an address for a host.
See Also
osl_resolveHostname()
Return
A new created socket-address or 0 if the name could not be found.

getServicePort
static sal_Int32 getServicePort(
const ::rtl::OUString & strServiceName,
const ::rtl::OUString & strProtocolName = :: rtl :: OUString :: createFromAscii "tcp" );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO YES YES NO

Summary
Tries to find the port associated with the given service/protocol- pair (e.g. "ftp"/"tcp").
Return
the port number in host-byte order or OSL_INVALID_PORT if no service/protocol pair could be found.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.