KNetwork::KMulticastSocketImpl Class Reference

`#include <kmulticastsocketdevice.h>`

Inheritance diagram for KNetwork::KMulticastSocketImpl:

## Public Member Functions

| KMulticastSocketImpl (const KSocketBase *=0L)
virtual | ~KMulticastSocketImpl ()
virtual int | capabilities () const
virtual bool | create (int family, int type, int protocol)
virtual bool | connect (const KResolverEntry &address)
virtual int | timeToLive () const
virtual bool | setTimeToLive (int ttl)
virtual bool | multicastLoop () const
virtual bool | setMulticastLoop (bool enable)
virtual KNetworkInterface | networkInterface ()
virtual bool | setNetworkInterface (const KNetworkInterface &iface)
virtual bool | joinGroup (const KSocketAddress &group)
virtual bool | joinGroup (const KSocketAddress &group, const KNetworkInterface &iface)
virtual bool | leaveGroup (const KSocketAddress &group)
virtual bool | leaveGroup (const KSocketAddress &group, const KNetworkInterface &iface)
Public Member Functions inherited from KNetwork::KSocketDevice
| KSocketDevice (const KSocketBase *=0L)
| KSocketDevice (int fd)
virtual | ~KSocketDevice ()
int | socket () const
virtual bool | setSocketOptions (int opts)
virtual bool | open (int mode)
virtual void | close ()
virtual void | flush ()
bool | create (const KResolverEntry &address)
virtual bool | bind (const KResolverEntry &address)
virtual bool | listen (int backlog=5)
virtual KSocketDevice * | accept ()
virtual bool | disconnect ()
virtual Q_LONG | bytesAvailable () const
virtual Q_LONG | waitForMore (int msecs, bool *timeout=0L)
virtual Q_LONG | readBlock (char *data, Q_ULONG maxlen)
virtual Q_LONG | readBlock (char *data, Q_ULONG maxlen, KSocketAddress &from)
virtual Q_LONG | peekBlock (char *data, Q_ULONG maxlen)
virtual Q_LONG | peekBlock (char *data, Q_ULONG maxlen, KSocketAddress &from)
virtual Q_LONG | writeBlock (const char *data, Q_ULONG len)
virtual Q_LONG | writeBlock (const char *data, Q_ULONG len, const KSocketAddress &to)
virtual KSocketAddress | localAddress () const
virtual KSocketAddress | peerAddress () const
virtual KSocketAddress | externalAddress () const
QSocketNotifier * | readNotifier () const
QSocketNotifier * | writeNotifier () const
QSocketNotifier * | exceptionNotifier () const
virtual bool | poll (bool *input, bool *output, bool *exception=0L, int timeout=-1, bool *timedout=0L)
bool | poll (int timeout=-1, bool *timedout=0L)
Public Member Functions inherited from KNetwork::KActiveSocketBase
| KActiveSocketBase ()
virtual | ~KActiveSocketBase ()
virtual Offset | size () const
virtual Offset | at () const
virtual bool | at (Offset)
virtual bool | atEnd () const
virtual int | getch ()
virtual int | putch (int ch)
virtual int | ungetch (int)
Public Member Functions inherited from KNetwork::KSocketBase
| KSocketBase ()
virtual | ~KSocketBase ()
virtual bool | setBlocking (bool enable)
bool | blocking () const
virtual bool | setAddressReuseable (bool enable)
bool | addressReuseable () const
virtual bool | setIPv6Only (bool enable)
bool | isIPv6Only () const
virtual bool | setBroadcast (bool enable)
bool | broadcast () const
KSocketDevice * | socketDevice () const
virtual void | setSocketDevice (KSocketDevice *device)
int | setRequestedCapabilities (int add, int remove=0)
SocketError | error () const
QString | errorString () const
QMutex * | mutex () const
Public Member Functions inherited from KNetwork::KPassiveSocketBase
| KPassiveSocketBase ()
virtual | ~KPassiveSocketBase ()

## Additional Inherited Members

Public Types inherited from KNetwork::KSocketDevice
enum | Capabilities { CanConnectString = 0x01, CanBindString = 0x02, CanNotBind = 0x04, CanNotListen = 0x08, CanMulticast = 0x10, CanNotUseDatagrams = 0x20 }
Public Types inherited from KNetwork::KSocketBase
enum | SocketOptions { Blocking = 0x01, AddressReuseable = 0x02, IPv6Only = 0x04, Keepalive = 0x08, Broadcast = 0x10 }
enum | SocketError { NoError = 0, LookupFailure, AddressInUse, AlreadyCreated, AlreadyBound, AlreadyConnected, NotConnected, NotBound, NotCreated, WouldBlock, ConnectionRefused, ConnectionTimedOut, InProgress, NetFailure, NotSupported, Timeout, UnknownError, RemotelyDisconnected }
Static Public Member Functions inherited from KNetwork::KSocketDevice
static KSocketDevice * | createDefault (KSocketBase *parent)
static KSocketDevice * | createDefault (KSocketBase *parent, int capabilities)
static KSocketDeviceFactoryBase * | setDefaultImpl (KSocketDeviceFactoryBase *factory)
static void | addNewImpl (KSocketDeviceFactoryBase *factory, int capabilities)
Static Public Member Functions inherited from KNetwork::KSocketBase
static QString | errorString (SocketError code)
static bool | isFatalError (int code)
Protected Member Functions inherited from KNetwork::KSocketDevice
| KSocketDevice (bool, const KSocketBase *parent=0L)
virtual QSocketNotifier * | createNotifier (QSocketNotifier::Type type) const
Protected Member Functions inherited from KNetwork::KActiveSocketBase
void | setError (int status, SocketError error)
void | resetError ()
Protected Member Functions inherited from KNetwork::KSocketBase
virtual int | socketOptions () const
bool | hasDevice () const
void | setError (SocketError error)
Protected Attributes inherited from KNetwork::KSocketDevice
int | m_sockfd

## Detailed Description

The low-level backend for multicasting sockets.

This class is an interface providing methods for handling multicast operations.

Author
  Thiago Macieira thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 45 of file kmulticastsocketdevice.h.

## Constructor & Destructor Documentation

KNetwork::KMulticastSocketImpl::KMulticastSocketImpl | ( | const KSocketBase * | = `0L` | ) |

Constructor.

virtual KNetwork::KMulticastSocketImpl::~KMulticastSocketImpl | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

virtual int KNetwork::KMulticastSocketImpl::capabilities | ( |  | ) | const

virtual

Sets our capabilities.

Reimplemented from KNetwork::KSocketDevice.

virtual bool KNetwork::KMulticastSocketImpl::connect | ( | const KResolverEntry & | address | ) |

virtual

Overrides connection.

Multicast sockets may not connect.

Reimplemented from KNetwork::KSocketDevice.

virtual bool KNetwork::KMulticastSocketImpl::create | ( | int | family,
|  | int | type,
|  | int | protocol
| ) |  |

virtual

Overrides the socket creation.

Reimplemented from KNetwork::KSocketDevice.

virtual bool KNetwork::KMulticastSocketImpl::joinGroup | ( | const KSocketAddress & | group | ) |

virtual

Joins a multicast group.

The group to be joined is identified by the `group` parameter.

Parameters

  group | the multicast group to join

Returns
  true on success

virtual bool KNetwork::KMulticastSocketImpl::joinGroup | ( | const KSocketAddress & | group,
|  | const KNetworkInterface & | iface
| ) |  |

virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Joins a multicast group.

This function also specifies the network interface to be used.

virtual bool KNetwork::KMulticastSocketImpl::leaveGroup | ( | const KSocketAddress & | group | ) |

virtual

Leaves a multicast group.

The group being left is given by its address in the `group` parameter.

Parameters

  group | the group to leave

Returns
  true on successful leaving the group

virtual bool KNetwork::KMulticastSocketImpl::leaveGroup | ( | const KSocketAddress & | group,
|  | const KNetworkInterface & | iface
| ) |  |

virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Leaves a multicast group.

virtual bool KNetwork::KMulticastSocketImpl::multicastLoop | ( |  | ) | const

virtual

Retrieves the flag indicating if sent packets will be echoed back to sender.

virtual KNetworkInterface KNetwork::KMulticastSocketImpl::networkInterface | ( |  | ) |

virtual

Retrieves the network interface this socket is associated to.

virtual bool KNetwork::KMulticastSocketImpl::setMulticastLoop | ( | bool | enable | ) |

virtual

Sets the flag indicating the loopback of packets to the sender.

Parameters

  enable | if true, will echo back

Returns
  true if setting the value was successful.

virtual bool KNetwork::KMulticastSocketImpl::setNetworkInterface | ( | const KNetworkInterface & | iface | ) |

virtual

Sets the network interface on which this socket should work.

Parameters

  iface | the interface to associate with

Returns
  true if setting the value was successful.

virtual bool KNetwork::KMulticastSocketImpl::setTimeToLive | ( | int | ttl | ) |

virtual

Sets the time-to-live/hop count for outgoing multicast packets.

Parameters

  ttl | the hop count, from 0 to 255

Returns
  true if setting the value was successful.

virtual int KNetwork::KMulticastSocketImpl::timeToLive | ( |  | ) | const

virtual

Retrieves the time-to-live/hop count value on multicast packets being sent.

The documentation for this class was generated from the following file:

- kmulticastsocketdevice.h

KDE Home | KDE Accessibility Home | Description of Access Keys