\section{KNetwork::KInet\-Socket\-Address Class Reference}
\label{classKNetwork_1_1KInetSocketAddress}\index{KNetwork::KInetSocketAddress@{KNetwork::KInetSocketAddress}}
an Internet socket address  


{\tt \#include $<$ksocketaddress.h$>$}

Inheritance diagram for KNetwork::KInet\-Socket\-Address:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{classKNetwork_1_1KInetSocketAddress__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KNetwork::KInet\-Socket\-Address:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{classKNetwork_1_1KInetSocketAddress__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KInet\-Socket\-Address} ()
\item 
{\bf KInet\-Socket\-Address} (const sockaddr $\ast$sa, Q\_\-UINT16 len)
\item 
{\bf KInet\-Socket\-Address} (const {\bf KIp\-Address} \&host, Q\_\-UINT16 port)
\item 
{\bf KInet\-Socket\-Address} (const {\bf KInet\-Socket\-Address} \&other)
\item 
{\bf KInet\-Socket\-Address} (const {\bf KSocket\-Address} \&other)
\item 
virtual {\bf $\sim$KInet\-Socket\-Address} ()
\item 
{\bf KInet\-Socket\-Address} \& {\bf operator=} (const {\bf KInet\-Socket\-Address} \&other)
\item 
{\bf operator const sockaddr\_\-in $\ast$} () const 
\item 
{\bf operator const sockaddr\_\-in6 $\ast$} () const 
\item 
int {\bf ip\-Version} () const 
\item 
{\bf KIp\-Address} {\bf ip\-Address} () const 
\item 
{\bf KInet\-Socket\-Address} \& {\bf set\-Host} (const {\bf KIp\-Address} \&addr)
\item 
Q\_\-UINT16 {\bf port} () const 
\item 
{\bf KInet\-Socket\-Address} \& {\bf set\-Port} (Q\_\-UINT16 port)
\item 
{\bf KInet\-Socket\-Address} \& {\bf make\-IPv4} ()
\item 
{\bf KInet\-Socket\-Address} \& {\bf make\-IPv6} ()
\item 
Q\_\-UINT32 {\bf flowinfo} () const 
\item 
{\bf KInet\-Socket\-Address} \& {\bf set\-Flowinfo} (Q\_\-UINT32 flowinfo)
\item 
int {\bf scope\-Id} () const 
\item 
{\bf KInet\-Socket\-Address} \& {\bf set\-Scope\-Id} (int scopeid)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf KInet\-Socket\-Address} (KSocket\-Address\-Data $\ast$d)\label{classKNetwork_1_1KInetSocketAddress_b0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KSocket\-Address}\label{classKNetwork_1_1KInetSocketAddress_n0}

\end{CompactItemize}


\subsection{Detailed Description}
an Internet socket address 

An Inet (IPv4 or IPv6) socket address

This is an IPv4 or IPv6 address of the Internet.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 641 of file ksocketaddress.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!KInetSocketAddress@{KInetSocketAddress}}
\index{KInetSocketAddress@{KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::KInet\-Socket\-Address ()}\label{classKNetwork_1_1KInetSocketAddress_a0}


Public constructor. 

Creates an empty object. 

Definition at line 677 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!KInetSocketAddress@{KInetSocketAddress}}
\index{KInetSocketAddress@{KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::KInet\-Socket\-Address (const sockaddr $\ast$ {\em sa}, Q\_\-UINT16 {\em len})}\label{classKNetwork_1_1KInetSocketAddress_a1}


Creates an object from raw data. 

Note: if the socket address {\tt sa} does not contain a valid Internet socket (IPv4 or IPv6), this object will be empty.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sa}]the sockaddr structure \item[{\em len}]the structure's length \end{description}
\end{Desc}


Definition at line 682 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!KInetSocketAddress@{KInetSocketAddress}}
\index{KInetSocketAddress@{KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::KInet\-Socket\-Address (const {\bf KIp\-Address} \& {\em host}, Q\_\-UINT16 {\em port})}\label{classKNetwork_1_1KInetSocketAddress_a2}


Creates an object from an IP address and port. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em host}]the IP address \item[{\em port}]the port number \end{description}
\end{Desc}


Definition at line 690 of file ksocketaddress.cpp.

References set\-Host(), and set\-Port().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!KInetSocketAddress@{KInetSocketAddress}}
\index{KInetSocketAddress@{KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::KInet\-Socket\-Address (const {\bf KInet\-Socket\-Address} \& {\em other})}\label{classKNetwork_1_1KInetSocketAddress_a3}


Copy constructor. 

Data is not shared.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em other}]the other object \end{description}
\end{Desc}


Definition at line 697 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!KInetSocketAddress@{KInetSocketAddress}}
\index{KInetSocketAddress@{KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::KInet\-Socket\-Address (const {\bf KSocket\-Address} \& {\em other})}\label{classKNetwork_1_1KInetSocketAddress_a4}


Copy constructor. 

If the other, generic socket address contains an Internet address, it will be copied. Otherwise, this object will be empty.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em other}]the other object \end{description}
\end{Desc}


Definition at line 703 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!~KInetSocketAddress@{$\sim$KInetSocketAddress}}
\index{~KInetSocketAddress@{$\sim$KInetSocketAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KInet\-Socket\-Address::$\sim${\bf KInet\-Socket\-Address} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KInetSocketAddress_a5}


Destroys this object. 



Definition at line 717 of file ksocketaddress.cpp.

\subsection{Member Function Documentation}
\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!operator=@{operator=}}
\index{operator=@{operator=}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::operator= (const {\bf KInet\-Socket\-Address} \& {\em other})}\label{classKNetwork_1_1KInetSocketAddress_a6}


Copy operator. 

Copies the other object into this one.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em other}]the other object \end{description}
\end{Desc}


Definition at line 723 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!operator const sockaddr_in *@{operator const sockaddr\_\-in $\ast$}}
\index{operator const sockaddr_in *@{operator const sockaddr\_\-in $\ast$}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KInet\-Socket\-Address::operator const sockaddr\_\-in $\ast$ () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KInetSocketAddress_a7}


Cast operator to sockaddr\_\-in. 



Definition at line 705 of file ksocketaddress.h.

References KSocket\-Address::address().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!operator const sockaddr_in6 *@{operator const sockaddr\_\-in6 $\ast$}}
\index{operator const sockaddr_in6 *@{operator const sockaddr\_\-in6 $\ast$}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KInet\-Socket\-Address::operator const sockaddr\_\-in6 $\ast$ () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KInetSocketAddress_a8}


Cast operator to sockaddr\_\-in6. 



Definition at line 711 of file ksocketaddress.h.

References KSocket\-Address::address().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!ipVersion@{ipVersion}}
\index{ipVersion@{ipVersion}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KInet\-Socket\-Address::ip\-Version () const}\label{classKNetwork_1_1KInetSocketAddress_a9}


Returns the IP version of the address this object holds. 

\begin{Desc}
\item[Returns:]4 or 6, if IPv4 or IPv6, respectively; 0 if this object is empty \end{Desc}


Definition at line 730 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!ipAddress@{ipAddress}}
\index{ipAddress@{ipAddress}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KIp\-Address} KInet\-Socket\-Address::ip\-Address () const}\label{classKNetwork_1_1KInetSocketAddress_a10}


Returns the IP address component. 



Definition at line 749 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!setHost@{setHost}}
\index{setHost@{setHost}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::set\-Host (const {\bf KIp\-Address} \& {\em addr})}\label{classKNetwork_1_1KInetSocketAddress_a11}


Sets the IP address to the given raw address. 

This call will preserve port numbers accross IP versions, but will lose IPv6 specific data if the address is set to IPv4.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]the address to set to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 767 of file ksocketaddress.cpp.

References make\-IPv4(), and make\-IPv6().

Referenced by KInet\-Socket\-Address().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!port@{port}}
\index{port@{port}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-UINT16 KInet\-Socket\-Address::port () const}\label{classKNetwork_1_1KInetSocketAddress_a12}


Retrieves the port number stored in this object. 

\begin{Desc}
\item[Returns:]a port number in the range 0 to 65535, inclusive. An empty or invalid object will have a port number of 0. \end{Desc}


Definition at line 790 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!setPort@{setPort}}
\index{setPort@{setPort}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::set\-Port (Q\_\-UINT16 {\em port})}\label{classKNetwork_1_1KInetSocketAddress_a13}


Sets the port number. 

If this object is empty, this function will default to creating an IPv4 address.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]the port number to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 809 of file ksocketaddress.cpp.

References make\-IPv4().

Referenced by KInet\-Socket\-Address().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!makeIPv4@{makeIPv4}}
\index{makeIPv4@{makeIPv4}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::make\-IPv4 ()}\label{classKNetwork_1_1KInetSocketAddress_a14}


Converts this object to an IPv4 socket address. 

It has no effect if the object is already an IPv4 socket address.

If this object is an IPv6 address, the port number is preserved. All other information is lost.

\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 833 of file ksocketaddress.cpp.

Referenced by set\-Host(), and set\-Port().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!makeIPv6@{makeIPv6}}
\index{makeIPv6@{makeIPv6}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::make\-IPv6 ()}\label{classKNetwork_1_1KInetSocketAddress_a15}


Converts this object to an IPv6 socket address. 

It has no effect if the object is already an IPv6 socket address.

If this object is an IPv4 address, the port number is preserved.

\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 839 of file ksocketaddress.cpp.

Referenced by set\-Flowinfo(), set\-Host(), and set\-Scope\-Id().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!flowinfo@{flowinfo}}
\index{flowinfo@{flowinfo}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-UINT32 KInet\-Socket\-Address::flowinfo () const}\label{classKNetwork_1_1KInetSocketAddress_a16}


Returns the flowinfo information from the IPv6 socket address. 

\begin{Desc}
\item[Returns:]the flowinfo information or 0 if this object is empty or IPv4 \end{Desc}


Definition at line 845 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!setFlowinfo@{setFlowinfo}}
\index{setFlowinfo@{setFlowinfo}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::set\-Flowinfo (Q\_\-UINT32 {\em flowinfo})}\label{classKNetwork_1_1KInetSocketAddress_a17}


Sets the flowinfo information for an IPv6 socket address. 

If this is not an IPv6 socket address, this function converts it to one. \begin{Desc}
\item[See also:]{\bf make\-IPv6}{\rm (p.\,\pageref{classKNetwork_1_1KInetSocketAddress_a15})}.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em flowinfo}]the flowinfo to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 857 of file ksocketaddress.cpp.

References make\-IPv6().\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!scopeId@{scopeId}}
\index{scopeId@{scopeId}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KInet\-Socket\-Address::scope\-Id () const}\label{classKNetwork_1_1KInetSocketAddress_a18}


Returns the scope id this IPv6 socket is bound to. 

\begin{Desc}
\item[Returns:]the scope id, or 0 if this is not an IPv6 object \end{Desc}


Definition at line 864 of file ksocketaddress.cpp.\index{KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}!setScopeId@{setScopeId}}
\index{setScopeId@{setScopeId}!KNetwork::KInetSocketAddress@{KNetwork::KInet\-Socket\-Address}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInet\-Socket\-Address} \& KInet\-Socket\-Address::set\-Scope\-Id (int {\em scopeid})}\label{classKNetwork_1_1KInetSocketAddress_a19}


Sets the scope id for this IPv6 object. 

If this is not an IPv6 socket address, this function converts it to one. \begin{Desc}
\item[See also:]{\bf make\-IPv6}{\rm (p.\,\pageref{classKNetwork_1_1KInetSocketAddress_a15})}\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em scopeid}]the scopeid to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a reference to itself \end{Desc}


Definition at line 876 of file ksocketaddress.cpp.

References make\-IPv6().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
ksocketaddress.h\item 
ksocketaddress.cpp\end{CompactItemize}
