<refentry id="GNetworkIpMulticast">
<refmeta>
<refentrytitle>GNetworkIpMulticast</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGNETWORK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GNetworkIpMulticast</refname><refpurpose>IP multicasting object.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>



            <link linkend="GNetworkIpMulticast-struct">GNetworkIpMulticast</link>;
            <link linkend="GNetworkIpMulticastClass">GNetworkIpMulticastClass</link>;
<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link>* <link linkend="gnetwork-ip-multicast-new">gnetwork_ip_multicast_new</link>
                                            (const <link linkend="gchar">gchar</link> *interface,
                                             <link linkend="guint">guint</link> port);
<link linkend="void">void</link>        <link linkend="gnetwork-ip-multicast-join-group">gnetwork_ip_multicast_join_group</link>
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast,
                                             const <link linkend="GNetworkIpAddress">GNetworkIpAddress</link> *group);
<link linkend="void">void</link>        <link linkend="gnetwork-ip-multicast-leave-group">gnetwork_ip_multicast_leave_group</link>
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast,
                                             const <link linkend="GNetworkIpAddress">GNetworkIpAddress</link> *group);
<link linkend="void">void</link>        <link linkend="gnetwork-ip-multicast-clear-groups">gnetwork_ip_multicast_clear_groups</link>
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----<link linkend="GNetworkUdpDatagram">GNetworkUdpDatagram</link>
         +----GNetworkIpMulticast
</synopsis>

</refsect1>



<refsect1>
<title>Implemented Interfaces</title>
<para>
GNetworkIpMulticast implements
 <link linkend="GNetworkDatagram">GNetworkDatagram</link>.</para>

</refsect1>


<refsect1>
<title>Properties</title>
<synopsis>

  &quot;<link linkend="GNetworkIpMulticast--multicast-groups">multicast-groups</link>&quot;     <link linkend="GValueArray">GValueArray</link>           : Read
  &quot;<link linkend="GNetworkIpMulticast--multicast-ttl">multicast-ttl</link>&quot;        <link linkend="GNetworkUdpDatagramTtl">GNetworkUdpDatagramTtl</link>  : Read / Write / Construct
</synopsis>
</refsect1>



<refsect1>
<title>Description</title>
<para>
The <link linkend="GNetworkIpMulticast"><type>GNetworkIpMulticast</type></link> object is a thin wrapper around a standard UDP socket
which provides easy access to IP multicasting services. This object does not
override the signals and methods of the <link linkend="GNetworkDatagramIface"><type>GNetworkDatagramIface</type></link> set by
<link linkend="GNetworkUdpDatagram"><type>GNetworkUdpDatagram</type></link>. Therefore, if you wish to use those interfaces, you should
use them as though your object was a <link linkend="GNetworkUdpDatagram"><type>GNetworkUdpDatagram</type></link> (because it is).
</para>

<para>
The "error" signal for <link linkend="GNetworkIpMulticast"><type>GNetworkIpMulticast</type></link> objects uses the <link linkend="G-THREAD-ERROR:CAPS"><type>G_THREAD_ERROR</type></link>,
<link linkend="GNETWORK-DNS-ERROR:CAPS"><type>GNETWORK_DNS_ERROR</type></link>, <link linkend="GNETWORK-DATAGRAM-ERROR:CAPS"><type>GNETWORK_DATAGRAM_ERROR</type></link>, <link linkend="GNETWORK-UDP-DATAGRAM-ERROR:CAPS"><type>GNETWORK_UDP_DATAGRAM_ERROR</type></link>, and
<link linkend="GNETWORK-IP-MULTICAST-ERROR:CAPS"><type>GNETWORK_IP_MULTICAST_ERROR</type></link> domains.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GNetworkIpMulticast-struct"/>GNetworkIpMulticast</title>
<indexterm><primary>GNetworkIpMulticast</primary></indexterm><programlisting>typedef struct _GNetworkIpMulticast GNetworkIpMulticast;</programlisting>
<para>
A structure representing a <link linkend="GNetworkIpMulticast"><type>GNetworkIpMulticast</type></link> object. There are no public
members in this structure.
</para></refsect2>
<refsect2>
<title><anchor id="GNetworkIpMulticastClass"/>GNetworkIpMulticastClass</title>
<indexterm><primary>GNetworkIpMulticastClass</primary></indexterm><programlisting>typedef struct {
} GNetworkIpMulticastClass;
</programlisting>
<para>
The class structure for <link linkend="GNetworkIpMulticast"><type>GNetworkIpMulticast</type></link> objects. There are no public
members in this structure.
</para></refsect2>
<refsect2>
<title><anchor id="gnetwork-ip-multicast-new"/>gnetwork_ip_multicast_new ()</title>
<indexterm role="1.0"><primary>gnetwork_ip_multicast_new</primary></indexterm><programlisting><link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link>* gnetwork_ip_multicast_new
                                            (const <link linkend="gchar">gchar</link> *interface,
                                             <link linkend="guint">guint</link> port);</programlisting>
<para>
Creates a new IP multicasting object which listens on <parameter>interface</parameter>:<parameter>port</parameter>. If
<parameter>interface</parameter> is <literal>NULL</literal>, then the object will listen on all local interfaces. If
<parameter>port</parameter> is <literal>0</literal>, then a port will be automatically chosen.
</para>
<para>
Unless you know you need a specific interface or port (for a server of some
kind), you should not request one.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>interface</parameter>&nbsp;:</term>
<listitem><simpara> the IP address of the local interface to listen on, or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>port</parameter>&nbsp;:</term>
<listitem><simpara> the local port to listen on, or <literal>0</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="GNetworkIpMulticast"><type>GNetworkIpMulticast</type></link> object.

</simpara></listitem></varlistentry>
</variablelist><para>Since  1.0
</para></refsect2>
<refsect2>
<title><anchor id="gnetwork-ip-multicast-join-group"/>gnetwork_ip_multicast_join_group ()</title>
<indexterm role="1.0"><primary>gnetwork_ip_multicast_join_group</primary></indexterm><programlisting><link linkend="void">void</link>        gnetwork_ip_multicast_join_group
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast,
                                             const <link linkend="GNetworkIpAddress">GNetworkIpAddress</link> *group);</programlisting>
<para>
Adds <parameter>group</parameter> to the list of groups that <parameter>multicast</parameter> is on. If <parameter>multicast</parameter> is
already connected, <parameter>groupwill</parameter> be joined immediately. Otherwise, it will be
joined after <parameter>multicast</parameter> connects.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>multicast</parameter>&nbsp;:</term>
<listitem><simpara> the multicast object to modify.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>group</parameter>&nbsp;:</term>
<listitem><simpara> the address of the group to join.
</simpara></listitem></varlistentry>
</variablelist><para>Since  1.0
</para></refsect2>
<refsect2>
<title><anchor id="gnetwork-ip-multicast-leave-group"/>gnetwork_ip_multicast_leave_group ()</title>
<indexterm role="1.0"><primary>gnetwork_ip_multicast_leave_group</primary></indexterm><programlisting><link linkend="void">void</link>        gnetwork_ip_multicast_leave_group
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast,
                                             const <link linkend="GNetworkIpAddress">GNetworkIpAddress</link> *group);</programlisting>
<para>
Removes <parameter>group</parameter> from the list of groups <parameter>multicast</parameter> is on. If <parameter>multicast</parameter> is
already connected, the group will be left immediately. Otherwise, <parameter>group</parameter> will
be removed from the list of groups to join after <parameter>multicast</parameter> connects.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>multicast</parameter>&nbsp;:</term>
<listitem><simpara> the multicast object to modify.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>group</parameter>&nbsp;:</term>
<listitem><simpara> the address of the group to leave.
</simpara></listitem></varlistentry>
</variablelist><para>Since  1.0
</para></refsect2>
<refsect2>
<title><anchor id="gnetwork-ip-multicast-clear-groups"/>gnetwork_ip_multicast_clear_groups ()</title>
<indexterm role="1.0"><primary>gnetwork_ip_multicast_clear_groups</primary></indexterm><programlisting><link linkend="void">void</link>        gnetwork_ip_multicast_clear_groups
                                            (<link linkend="GNetworkIpMulticast">GNetworkIpMulticast</link> *multicast);</programlisting>
<para>
Clears the list of groups <parameter>multicast</parameter> is on. If <parameter>multicast</parameter> is connected, the
groups will be left immediately. Otherwise, the list of groups to join after
<parameter>multicast</parameter> connects will be cleared.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>multicast</parameter>&nbsp;:</term>
<listitem><simpara> the multicast object to modify.
</simpara></listitem></varlistentry>
</variablelist><para>Since  1.0
</para></refsect2>

</refsect1>
<refsect1>
<title>Properties</title>
<refsect2><title><anchor id="GNetworkIpMulticast--multicast-groups"/>The &quot;<literal>multicast-groups</literal>&quot; property</title>
<programlisting>  &quot;multicast-groups&quot;     <link linkend="GValueArray">GValueArray</link>           : Read</programlisting>
<para>A value array of the IP addresses of groups this socket has joined to when open.</para></refsect2>
<refsect2><title><anchor id="GNetworkIpMulticast--multicast-ttl"/>The &quot;<literal>multicast-ttl</literal>&quot; property</title>
<programlisting>  &quot;multicast-ttl&quot;        <link linkend="GNetworkUdpDatagramTtl">GNetworkUdpDatagramTtl</link>  : Read / Write / Construct</programlisting>
<para>The distance multicast messages sent through this datagram should travel.</para><para>Default value: GNETWORK_UDP_DATAGRAM_TTL_DEFAULT</para>
</refsect2>

</refsect1>




</refentry>
