.TH "KSocketAddress" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.ti -1c
.RI "virtual \fBQString\fP \fBpretty\fP () const "
.br
.ti -1c
.RI "const sockaddr * \fBaddress\fP () const "
.br
.ti -1c
.RI "virtual ksocklen_t \fBsize\fP () const "
.br
.ti -1c
.RI "\fBoperator const sockaddr *\fP () const "
.br
.ti -1c
.RI "int \fBfamily\fP () const "
.br
.ti -1c
.RI "int \fBianaFamily\fP () const "
.br
.ti -1c
.RI "virtual bool \fBisEqual\fP (const \fBKSocketAddress\fP &other) const "
.br
.ti -1c
.RI "bool \fBisEqual\fP (const \fBKSocketAddress\fP *other) const "
.br
.ti -1c
.RI "bool \fBoperator==\fP (const \fBKSocketAddress\fP &other) const "
.br
.ti -1c
.RI "bool \fBisCoreEqual\fP (const \fBKSocketAddress\fP &other) const "
.br
.ti -1c
.RI "bool \fBisCoreEqual\fP (const \fBKSocketAddress\fP *other) const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBnodeName\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBserviceName\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKSocketAddress\fP * \fBnewAddress\fP (const struct sockaddr *sa, ksocklen_t size)"
.br
.ti -1c
.RI "static int \fBianaFamily\fP (int af)"
.br
.ti -1c
.RI "static int \fBfromIanaFamily\fP (int iana)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKSocketAddress\fP ()"
.br
.ti -1c
.RI "\fBKSocketAddress\fP (const sockaddr *sa, ksocklen_t size)"
.br
.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 <thiago.macieira@kdemail.net> 
.RE
.PP

.PP
Definition at line 46 of file ksockaddr.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KSocketAddress::KSocketAddress ()\fC [inline, protected]\fP"
.PP
Creates an empty class. 
.PP
Definition at line 53 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. 
.PP
\fBParameters:\fP
.RS 4
\fIsa\fP a sockaddr structure 
.br
\fIsize\fP the size of \fCsa\fP 
.RE
.PP

.PP
Definition at line 83 of file ksockaddr.cpp.
.SS "KSocketAddress::~\fBKSocketAddress\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
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. 
.PP
\fBReturns:\fP
.RS 4
a pretty string representation 
.RE
.PP

.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. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr structure, can be 0 
.RE
.PP

.PP
Reimplemented in \fBKUnixSocketAddress\fP.
.PP
Definition at line 78 of file ksockaddr.h.
.PP
Referenced by KNetwork::KInetSocketAddress::operator const sockaddr_in *(), KNetwork::KInetSocketAddress::operator const sockaddr_in6 *(), KNetwork::KUnixSocketAddress::operator const sockaddr_un *(), and KUnixSocketAddress::operator const sockaddr_un *().
.SS "virtual ksocklen_t KSocketAddress::size () const\fC [inline, virtual]\fP"
.PP
Returns sockaddr structure size. 
.PP
\fBReturns:\fP
.RS 4
the size of the sockaddr structre, 0 if there is none. 
.RE
.PP

.PP
Reimplemented in \fBKInetSocketAddress\fP.
.PP
Definition at line 85 of file ksockaddr.h.
.SS "KSocketAddress::operator const sockaddr * () const\fC [inline]\fP"
.PP
Returns a sockaddr structure, for passing down to library functions. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr structure, can be 0. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBaddress()\fP 
.RE
.PP

.PP
Definition at line 93 of file ksockaddr.h.
.SS "int KSocketAddress::family () const"
.PP
Returns the family of this address. 
.PP
\fBReturns:\fP
.RS 4
the family of this address, AF_UNSPEC if it's undefined 
.RE
.PP

.PP
Definition at line 115 of file ksockaddr.cpp.
.PP
Referenced by isCoreEqual(), and isEqual().
.SS "int KSocketAddress::ianaFamily () const\fC [inline]\fP"
.PP
Returns the IANA family number of this address. 
.PP
\fBReturns:\fP
.RS 4
the IANA family number of this address (1 for AF_INET. 2 for AF_INET6, otherwise 0) 
.RE
.PP

.PP
Definition at line 107 of file ksockaddr.h.
.SS "bool KSocketAddress::isEqual (const \fBKSocketAddress\fP & other) const\fC [virtual]\fP"
.PP
Returns true if this equals the other socket. 
.PP
\fBParameters:\fP
.RS 4
\fIother\fP the other socket 
.RE
.PP
\fBReturns:\fP
.RS 4
true if both sockets are equal 
.RE
.PP

.PP
Definition at line 159 of file ksockaddr.cpp.
.PP
References KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), and family().
.SS "bool KSocketAddress::operator== (const \fBKSocketAddress\fP & other) const\fC [inline]\fP"
.PP
Overloaded == operator. 
.PP
\fBSee also:\fP
.RS 4
\fBisEqual()\fP 
.RE
.PP

.PP
Definition at line 123 of file ksockaddr.h.
.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. 
.PP
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

.PP
Definition at line 179 of file ksockaddr.cpp.
.PP
References KInetSocketAddress::areEqualInet(), KInetSocketAddress::areEqualInet6(), KUnixSocketAddress::areEqualUnix(), and family().
.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. 
.PP
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

.PP
Definition at line 148 of file ksockaddr.h.
.SS "\fBQString\fP KSocketAddress::nodeName () const\fC [virtual]\fP"
.PP
Returns the node name of this socket, as KExtendedSocket::lookup expects as the first argument. 
.PP
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

.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 KExtendedSocket::lookup expects as the service argument. 
.PP
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

.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 * sa, ksocklen_t size)\fC [static]\fP"
.PP
Creates a new KSocketAddress or descendant class from given raw socket address. 
.PP
\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

.PP
Definition at line 123 of file ksockaddr.cpp.
.PP
References KSocketAddress().
.SS "int KSocketAddress::ianaFamily (int af)\fC [static]\fP"
.PP
Returns the IANA family number of the given address family. 
.PP
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

.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. 
.PP
\fBReturns:\fP
.RS 4
the address family, AF_UNSPEC for unknown IANA family numbers 
.RE
.PP

.PP
Definition at line 221 of file ksockaddr.cpp.

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