class KSocketAddress

a socket address. More...

Definition#include <ksockaddr.h>
InheritsQObject (qt) [public ]
Inherited byKInetSocketAddress, KUnixSocketAddress
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Public Members

Protected Methods

Protected Members


Detailed Description

A socket address.

This class envelopes almost if not all socket addresses.

 KSocketAddress ()

KSocketAddress

[protected]

Creates an empty class

 KSocketAddress (const sockaddr* sa, ksocklen_t size)

KSocketAddress

[protected]

Creates with given data

 ~KSocketAddress ()

~KSocketAddress

[virtual]

Destructor.

QString  pretty ()

pretty

[const virtual]

Returns a string representation of this socket

const sockaddr*  address ()

address

[const]

Returns a sockaddr structure, for passing down to library functions

ksocklen_t  size ()

size

[const virtual]

Returns sockaddr structure size

 operator const sockaddr* ()

operator const sockaddr*

[const]

Returns a sockaddr structure, for passing down to library functions

int  family ()

family

[const]

Returns the family of this address AF_UNSPEC if it's undefined

inline int  ianaFamily ()

ianaFamily

[const]

Returns the IANA family number of this address

bool  isEqual (const KSocketAddress& other)

isEqual

[const virtual]

Returns true if this equals the other socket

Parameters:
otherthe other socket

bool  isEqual (const KSocketAddress* other)

isEqual

[const]

bool  operator== (const KSocketAddress& other)

operator==

[const]

bool  isCoreEqual (const KSocketAddress& other)

isCoreEqual

[const]

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.

If not possible, like the default implementation, this returns the same as isEqual.

Parameters:
otherthe other socket

bool  isCoreEqual (const KSocketAddress* other)

isCoreEqual

[const]

QString  nodeName ()

nodeName

[const virtual]

Returns the node name of this socket, as KExtendedSocket::lookup expects as the first argument. In the case of Internet sockets, this is the hostname. The default implementation returns QString::null.

QString  serviceName ()

serviceName

[const virtual]

Returns the service name for this socket, as KExtendedSocket::lookup expects as the service argument. In the case of Internet sockets, this is the port number. The default implementation returns QString::null.

sockaddr* data

data

[protected]

ksocklen_t datasize

datasize

[protected]

bool owndata

owndata

[protected]

KSocketAddress*  newAddress (const struct sockaddr*, ksocklen_t size)

newAddress

[static]

Creates a new KSocketAddress or descendant class from given raw socket address

Parameters:
sanew socket address
sizenew socket address's length

int  ianaFamily (int af)

ianaFamily

[static]

Returns the IANA family number of the given address family returns 0 if there is no corresponding IANA family number

Parameters:
afthe address family, in AF_* constants

int  fromIanaFamily (int iana)

fromIanaFamily

[static]

Returns the address family of the given IANA family number returns AF_UNSPEC for unknown IANA family numbers

friend class KExtendedSocket

KExtendedSocket

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]