Logo Search packages:      
Sourcecode: kdenetwork version File versions

QString KSocketAddress::serviceName (  )  const [virtual, inherited]

Returns the service name for this socket.

In the case of Internet sockets, this is the port number. The default implementation returns QString::null.

the service name, can be QString::null
use KResolver to resolve unknown families

Definition at line 581 of file ksocketaddress.cpp.

References KNetwork::KSocketAddress::d.

Referenced by KNetwork::KHttpProxySocketDevice::connect(), and KNetwork::KSocketAddress::toString().

  if (d->invalid())
    return QString::null;

  switch (d->addr.generic->sa_family)
    case AF_INET:
#ifdef AF_INET6
    case AF_INET6:
      return QString::number(d->ref.port());

    case AF_UNIX:
      return d->ref.pathname();

  return QString::null;

Generated by  Doxygen 1.6.0   Back to index