Herqq

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# HMulticastSocket Class Reference

This is a class for multicast communication. More...

`#include <HMulticastSocket>`

List of all members.

## Public Member Functions
| HMulticastSocket (QObject *parent=0)
virtual | ~HMulticastSocket ()
bool | joinMulticastGroup (const QHostAddress &groupAddress)
bool | joinMulticastGroup (const QHostAddress &groupAddress, const QHostAddress &localAddress)
bool | leaveMulticastGroup (const QHostAddress &groupAddress)
bool | leaveMulticastGroup (const QHostAddress &groupAddress, const QHostAddress &localAddress)
bool | setMulticastTtl (quint8 arg)
bool | bind (quint16 port=0)

## Detailed Description

This is a class for multicast communication.

Remarks:
  this class has thread-affinity, which mandates that the instances of this class has to be used in the thread in which they are located at the time.

## Constructor & Destructor Documentation

HMulticastSocket | ( | QObject * | parent = `0` | ) | `[explicit]`

Constructs a new instance.

Parameters:

  parent | specifies the parent `QObject`.

~HMulticastSocket | ( |  | ) | `[virtual]`

Destroys the instance.

## Member Function Documentation

bool joinMulticastGroup | ( | const QHostAddress & | groupAddress | ) |

Attempts to joins into the specified multicast group address.

Parameters:

  groupAddress | specifies the multicast group address.

Return values:

  true | in case the operation succeeded.
  false | in case the operation failed. For instance, this happens when the socket is not bound to a port.

bool joinMulticastGroup | ( | const QHostAddress & | groupAddress,
|  | const QHostAddress & | localAddress
| ) |  |

Attempts to joins into the specified multicast group address using the specified local address.

Parameters:

  groupAddress | specifies the multicast group address.
  localAddress | specifies the local addresses from which the join message is sent.

Return values:

  true | in case the operation succeeded.
  false | in case the operation failed. For instance, this happens when the socket is not bound to a port.

bool leaveMulticastGroup | ( | const QHostAddress & | groupAddress | ) |

Attempts to leave from the specified multicast group address.

Parameters:

  groupAddress | specifies the multicast group address.

Return values:

  true | in case the operation succeeded.
  false | in case the operation failed. For example, this happens when the socket has not joined to the specified multicast address.

bool leaveMulticastGroup | ( | const QHostAddress & | groupAddress,
|  | const QHostAddress & | localAddress
| ) |  |

Attempts to leave from the specified multicast group address using the specified local address.

Parameters:

  groupAddress | specifies the multicast group address.
  localAddress | specifies the local addresses from which the leave message is sent.

Return values:

  true | in case the operation succeeded.
  false | in case the operation failed. For example, this happens when the socket has not joined to the specified multicast address.

bool setMulticastTtl | ( | quint8 | arg | ) |

Attempts to set the Time To Live attribute for each message.

Parameters:

  arg | specifies the value for Time To Live.

Returns:
  true in case the operation succeeded.

bool bind | ( | quint16 | port = `0` | ) |

Attempts to bind the socket into the specified port using BindMode flags and a QHostAddress value that are suitable for a multicast socket.

Parameters:

  port | specifies the port to which to bind.

Returns:
  true in case the operation succeeded.