class KSocketAddress

a socket address. More...

Definition#include <ksockaddr.h>
InheritsQObject (qt)
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 ()

[protected]

Creates an empty class

 KSocketAddress (sockaddr* sa, ksocklen_t size)

[protected]

Creates with given data

KSocketAddress ()

[virtual]

Destructor.

QString  pretty ()

[const virtual]

Returns a string representation of this socket

const sockaddr*  address ()

[const]

Returns a sockaddr structure, for passing down to library functions

ksocklen_t  size ()

[const virtual]

Returns sockaddr structure size

 operator const sockaddr* ()

[const]

Returns a sockaddr structure, for passing down to library functions

int  family ()

[const]

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

inline int  ianaFamily ()

[const]

Returns the IANA family number of this address

bool  isEqual (const KSocketAddress& other)

[const virtual]

Returns true if this equals the other socket

Parameters:
otherthe other socket

bool  isCoreEqual (const KSocketAddress& other)

[const virtual]

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

KSocketAddress*  newAddress (struct sockaddr*, ksocklen_t size)

[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)

[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)

[static]

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