KNetwork::KMulticastSocket Class Reference

`#include <kmulticastsocket.h>`

Inheritance diagram for KNetwork::KMulticastSocket:

## Public Member Functions

| KMulticastSocket (QObject *parent=0L, const char *name=0L)
| ~KMulticastSocket ()
KMulticastSocketImpl * | multicastSocketDevice ()
const KMulticastSocketImpl * | multicastSocketDevice () const
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::KDatagramSocket
| KDatagramSocket (QObject *parent=0L, const char *name=0L)
virtual | ~KDatagramSocket ()
virtual bool | bind (const QString &node=QString::null, const QString &service=QString::null)
virtual bool | bind (const KResolverEntry &entry)
virtual bool | connect (const QString &node=QString::null, const QString &service=QString::null)
virtual bool | connect (const KResolverEntry &entry)
virtual Q_LONG | writeBlock (const char *data, Q_ULONG len, const KSocketAddress &to)
virtual KDatagramPacket | receive ()
virtual Q_LONG | send (const KDatagramPacket &packet)
Public Member Functions inherited from KNetwork::KClientSocketBase
| KClientSocketBase (QObject *parent, const char *name)
virtual | ~KClientSocketBase ()
SocketState | state () const
KResolver & | peerResolver () const
const KResolverResults & | peerResults () const
KResolver & | localResolver () const
const KResolverResults & | localResults () const
void | setResolutionEnabled (bool enable)
void | setFamily (int families)
virtual bool | lookup ()
void | connectToHost (const QString &host, Q_UINT16 port)
virtual bool | disconnect ()
virtual bool | open (int)
virtual void | close ()
virtual void | flush ()
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 KSocketAddress | localAddress () const
virtual KSocketAddress | peerAddress () const
bool | emitsReadyRead () const
virtual void | enableRead (bool enable)
bool | emitsReadyWrite () const
virtual void | enableWrite (bool enable)
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

## Additional Inherited Members

Public Types inherited from KNetwork::KClientSocketBase
enum | SocketState { Idle, HostLookup, HostFound, Bound, Connecting, Open, Closing, Unconnected = Bound, Connected = Open, Connection = Open }
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 }
Signals inherited from KNetwork::KClientSocketBase
void | stateChanged (int newstate)
void | gotError (int code)
void | hostFound ()
void | bound (const KResolverEntry &local)
void | aboutToConnect (const KResolverEntry &remote, bool &skip)
void | connected (const KResolverEntry &remote)
void | closed ()
void | readyRead ()
void | readyWrite ()
Static Public Member Functions inherited from KNetwork::KSocketBase
static QString | errorString (SocketError code)
static bool | isFatalError (int code)
Protected Slots inherited from KNetwork::KClientSocketBase
virtual void | slotReadActivity ()
virtual void | slotWriteActivity ()
Protected Member Functions inherited from KNetwork::KClientSocketBase
virtual bool | setSocketOptions (int opts)
void | setState (SocketState state)
virtual void | stateChanging (SocketState newState)
void | copyError ()
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)

## Detailed Description

A multicast-capable datagram socket class.

This class derives from KDatagramSocket adding methods to it to allow better control over the multicast functionality. In special, the join and leave group functions are added.

Other more low-level options on multicast sockets can be accessed directly with the KMulticastSocketImpl class returned by multicastSocketDevice.

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

Definition at line 48 of file kmulticastsocket.h.

## Constructor & Destructor Documentation

KNetwork::KMulticastSocket::KMulticastSocket | ( | QObject * | parent = `0L`,
|  | const char * | name = `0L`
| ) |  |

Constructor.

KNetwork::KMulticastSocket::~KMulticastSocket | ( |  | ) |

Destructor.

## Member Function Documentation

virtual bool KNetwork::KMulticastSocket::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::KMulticastSocket::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::KMulticastSocket::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::KMulticastSocket::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.

KMulticastSocketImpl* KNetwork::KMulticastSocket::multicastSocketDevice | ( |  | ) |

Returns the multicast socket device in use by this object.

Note
  The returned object can be null.

const KMulticastSocketImpl* KNetwork::KMulticastSocket::multicastSocketDevice | ( |  | ) | const

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

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

- kmulticastsocket.h

KDE Home | KDE Accessibility Home | Description of Access Keys