.TH "KSocketAddress" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSocketAddress \- A socket address. a socket address.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ksockaddr.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
Inherited by \fBKInetSocketAddress\fP, and \fBKUnixSocketAddress\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual \fB~KSocketAddress\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBpretty\fP () const "
.br
.RI "\fIReturns a string representation of this socket. \fP"
.ti -1c
.RI "const  sockaddr * \fBaddress\fP () const "
.br
.RI "\fIReturns a sockaddr structure, for passing down to library functions. \fP"
.ti -1c
.RI "virtual ksocklen_t \fBsize\fP () const "
.br
.RI "\fIReturns sockaddr structure size. \fP"
.ti -1c
.RI "\fBoperator const sockaddr *\fP () const "
.br
.RI "\fIReturns a sockaddr structure, for passing down to library functions. \fP"
.ti -1c
.RI "int \fBfamily\fP () const "
.br
.RI "\fIReturns the family of this address. \fP"
.ti -1c
.RI "int \fBianaFamily\fP () const "
.br
.RI "\fIReturns the IANA family number of this address. \fP"
.ti -1c
.RI "virtual bool \fBisEqual\fP (const  \fBKSocketAddress\fP &other) const "
.br
.RI "\fIReturns true if this equals the other socket. \fP"
.ti -1c
.RI "bool \fBisEqual\fP (const  \fBKSocketAddress\fP *other) const "
.br
.ti -1c
.RI "bool \fBoperator==\fP (const  \fBKSocketAddress\fP &other) const "
.br
.RI "\fIOverloaded == operator. \fP"
.ti -1c
.RI "bool \fBisCoreEqual\fP (const  \fBKSocketAddress\fP &other) const "
.br
.RI "\fISome sockets may differ in such things as services or port numbers, like Internet sockets. \fP"
.ti -1c
.RI "bool \fBisCoreEqual\fP (const  \fBKSocketAddress\fP *other) const "
.br
.RI "\fISome sockets may differ in such things as services or port numbers, like Internet sockets. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBnodeName\fP () const "
.br
.RI "\fIReturns the node name of this socket, as \fBKExtendedSocket::lookup\fP expects as the first argument. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBserviceName\fP () const "
.br
.RI "\fIReturns the service name for this socket, as \fBKExtendedSocket::lookup\fP expects as the service argument. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKSocketAddress\fP * \fBnewAddress\fP (const  struct sockaddr *, ksocklen_t size)"
.br
.RI "\fICreates a new KSocketAddress or descendant class from given raw socket address. \fP"
.ti -1c
.RI "int \fBianaFamily\fP (int af)"
.br
.RI "\fIReturns the IANA family number of the given address family. \fP"
.ti -1c
.RI "int \fBfromIanaFamily\fP (int iana)"
.br
.RI "\fIReturns the address family of the given IANA family number. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKSocketAddress\fP ()"
.br
.RI "\fICreates an empty class. \fP"
.ti -1c
.RI "\fBKSocketAddress\fP (const  sockaddr *sa, ksocklen_t size)"
.br
.RI "\fICreates with given data. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "sockaddr * \fBdata\fP"
.br
.ti -1c
.RI "ksocklen_t \fBdatasize\fP"
.br
.ti -1c
.RI "bool \fBowndata\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKExtendedSocket\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A socket address. a socket address. 

This class envelopes almost if not all socket addresses.
.PP
\fBAuthor:\fP
.RS 4
Thiago Macieira <thiagom@mail.com> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBksockaddr.h\fP,v 1.15 2002/09/09 21:11:35 tjansen Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 48 of file ksockaddr.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSocketAddress::KSocketAddress ()\fC [inline, protected]\fP"
.PP
Creates an empty class. Definition at line 55 of file ksockaddr.h.
.PP
Referenced by newAddress().
.SS "KSocketAddress::KSocketAddress (const sockaddr * sa, ksocklen_t size)\fC [protected]\fP"
.PP
Creates with given data. \fBParameters:\fP
.RS 4
\fIsa\fP a sockaddr structure 
.br
\fIsize\fP the size of \fCsa\fP 
.RE
.PP
Definition at line 83 of file ksockaddr.cpp.
.SS "KSocketAddress::~\fBKSocketAddress\fP ()\fC [virtual]\fP"
.PP
Destructor. Definition at line 104 of file ksockaddr.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KSocketAddress::pretty () const\fC [virtual]\fP"
.PP
Returns a string representation of this socket. \fBReturns:\fP
.RS 4
a pretty string representation 
.RE
.PP
Reimplemented in \fBKInetSocketAddress\fP, and \fBKUnixSocketAddress\fP.
.PP
Definition at line 110 of file ksockaddr.cpp.
.SS "const sockaddr* KSocketAddress::address () const\fC [inline]\fP"
.PP
Returns a sockaddr structure, for passing down to library functions. \fBReturns:\fP
.RS 4
the sockaddr structure, can be 0 
.RE
.PP
Reimplemented in \fBKUnixSocketAddress\fP.
.PP
Definition at line 80 of file ksockaddr.h.
.PP
Referenced by KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), and KServerSocket::port().
.SS "virtual ksocklen_t KSocketAddress::size () const\fC [inline, virtual]\fP"
.PP
Returns sockaddr structure size. \fBReturns:\fP
.RS 4
the size of the sockaddr structre, 0 if there is none. 
.RE
.PP
Reimplemented in \fBKInetSocketAddress\fP.
.PP
Definition at line 87 of file ksockaddr.h.
.PP
Referenced by KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), KUnixSocketAddress::KUnixSocketAddress(), and KAddressInfo::length().
.SS "KSocketAddress::operator const sockaddr * () const\fC [inline]\fP"
.PP
Returns a sockaddr structure, for passing down to library functions. \fBReturns:\fP
.RS 4
the sockaddr structure, can be 0. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBaddress()\fP 
.RE
.PP
Definition at line 95 of file ksockaddr.h.
.SS "int KSocketAddress::family () const"
.PP
Returns the family of this address. \fBReturns:\fP
.RS 4
the family of this address, AF_UNSPEC if it's undefined 
.RE
.PP
Definition at line 115 of file ksockaddr.cpp.
.PP
Referenced by KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), ianaFamily(), isCoreEqual(), isEqual(), KInetSocketAddress::KInetSocketAddress(), and KInetSocketAddress::setAddress().
.SS "int KSocketAddress::ianaFamily () const\fC [inline]\fP"
.PP
Returns the IANA family number of this address. \fBReturns:\fP
.RS 4
the IANA family number of this address (1 for AF_INET. 2 for AF_INET6, otherwise 0) 
.RE
.PP
Definition at line 109 of file ksockaddr.h.
.PP
References family().
.SS "bool KSocketAddress::isEqual (const \fBKSocketAddress\fP & other) const\fC [virtual]\fP"
.PP
Returns true if this equals the other socket. \fBParameters:\fP
.RS 4
\fIother\fP the other socket 
.RE
.PP
\fBReturns:\fP
.RS 4
true if both sockets are equal 
.RE
.PP
Definition at line 159 of file ksockaddr.cpp.
.PP
References KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), data, datasize, and family().
.PP
Referenced by operator==().
.SS "bool KSocketAddress::operator== (const \fBKSocketAddress\fP & other) const\fC [inline]\fP"
.PP
Overloaded == operator. \fBSee also:\fP
.RS 4
\fBisEqual()\fP 
.RE
.PP
Definition at line 125 of file ksockaddr.h.
.PP
References isEqual().
.SS "bool KSocketAddress::isCoreEqual (const \fBKSocketAddress\fP & other) const"
.PP
Some sockets may differ in such things as services or port numbers, like Internet sockets. This function compares only the core part of that, if possible.
.PP
If not possible, like the default implementation, this returns the same as isEqual. 
.PP
\fBParameters:\fP
.RS 4
\fIother\fP the other socket 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the code part is equal 
.RE
.PP
Definition at line 179 of file ksockaddr.cpp.
.PP
References KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), and family().
.PP
Referenced by isCoreEqual().
.SS "bool KSocketAddress::isCoreEqual (const \fBKSocketAddress\fP * other) const\fC [inline]\fP"
.PP
Some sockets may differ in such things as services or port numbers, like Internet sockets. This function compares only the core part of that, if possible.
.PP
If not possible, like the default implementation, this returns the same as isEqual. 
.PP
\fBParameters:\fP
.RS 4
\fIother\fP the other socket 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the code part is equal 
.RE
.PP
Definition at line 150 of file ksockaddr.h.
.PP
References isCoreEqual().
.SS "\fBQString\fP KSocketAddress::nodeName () const\fC [virtual]\fP"
.PP
Returns the node name of this socket, as \fBKExtendedSocket::lookup\fP expects as the first argument. In the case of Internet sockets, this is the hostname. The default implementation returns QString::null. 
.PP
\fBReturns:\fP
.RS 4
the node name, can be QString::null 
.RE
.PP
Reimplemented in \fBKInetSocketAddress\fP.
.PP
Definition at line 196 of file ksockaddr.cpp.
.SS "\fBQString\fP KSocketAddress::serviceName () const\fC [virtual]\fP"
.PP
Returns the service name for this socket, as \fBKExtendedSocket::lookup\fP expects as the service argument. In the case of Internet sockets, this is the port number. The default implementation returns QString::null. 
.PP
\fBReturns:\fP
.RS 4
the service name, can be QString::null 
.RE
.PP
Reimplemented in \fBKInetSocketAddress\fP, and \fBKUnixSocketAddress\fP.
.PP
Definition at line 201 of file ksockaddr.cpp.
.SS "\fBKSocketAddress\fP * KSocketAddress::newAddress (const struct sockaddr *, ksocklen_t size)\fC [static]\fP"
.PP
Creates a new KSocketAddress or descendant class from given raw socket address. \fBParameters:\fP
.RS 4
\fIsa\fP new socket address 
.br
\fIsize\fP new socket address's length 
.RE
.PP
\fBReturns:\fP
.RS 4
the new KSocketAddress, or 0 if the function failed 
.RE
.PP
Definition at line 123 of file ksockaddr.cpp.
.PP
References KSocketAddress().
.PP
Referenced by KExtendedSocket::localAddress(), and KExtendedSocket::peerAddress().
.SS "int KSocketAddress::ianaFamily (int af)\fC [static]\fP"
.PP
Returns the IANA family number of the given address family. Returns 0 if there is no corresponding IANA family number. 
.PP
\fBParameters:\fP
.RS 4
\fIaf\fP the address family, in AF_* constants 
.RE
.PP
\fBReturns:\fP
.RS 4
the IANA family number of this address (1 for AF_INET. 2 for AF_INET6, otherwise 0) 
.RE
.PP
Definition at line 206 of file ksockaddr.cpp.
.SS "int KSocketAddress::fromIanaFamily (int iana)\fC [static]\fP"
.PP
Returns the address family of the given IANA family number. \fBReturns:\fP
.RS 4
the address family, AF_UNSPEC for unknown IANA family numbers 
.RE
.PP
Definition at line 221 of file ksockaddr.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
