![]() | ![]() | ![]() | GNetwork Library Manual | ![]() |
---|
GNetworkIpMulticast — IP multicasting object.
struct GNetworkIpMulticast; struct GNetworkIpMulticastClass; GNetworkIpMulticast* gnetwork_ip_multicast_new (const gchar *interface, guint port); void gnetwork_ip_multicast_join_group (GNetworkIpMulticast *multicast, const GNetworkIpAddress *group); void gnetwork_ip_multicast_leave_group (GNetworkIpMulticast *multicast, const GNetworkIpAddress *group); void gnetwork_ip_multicast_clear_groups (GNetworkIpMulticast *multicast);
"multicast-groups" GValueArray : Read "multicast-ttl" GNetworkUdpDatagramTtl : Read / Write / Construct
The GNetworkIpMulticast 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 GNetworkDatagramIface set by GNetworkUdpDatagram. Therefore, if you wish to use those interfaces, you should use them as though your object was a GNetworkUdpDatagram (because it is).
The "error" signal for GNetworkIpMulticast objects uses the G_THREAD_ERROR, GNETWORK_DNS_ERROR, GNETWORK_DATAGRAM_ERROR, GNETWORK_UDP_DATAGRAM_ERROR, and GNETWORK_IP_MULTICAST_ERROR domains.
struct GNetworkIpMulticast;
A structure representing a GNetworkIpMulticast object. There are no public members in this structure.
struct GNetworkIpMulticastClass { };
The class structure for GNetworkIpMulticast objects. There are no public members in this structure.
GNetworkIpMulticast* gnetwork_ip_multicast_new (const gchar *interface, guint port);
Creates a new IP multicasting object which listens on interface:port. If interface is NULL, then the object will listen on all local interfaces. If port is 0, then a port will be automatically chosen.
Unless you know you need a specific interface or port (for a server of some kind), you should not request one.
interface : | the IP address of the local interface to listen on, or NULL. |
port : | the local port to listen on, or 0. |
Returns : | a new GNetworkIpMulticast object. |
Since 1.0
void gnetwork_ip_multicast_join_group (GNetworkIpMulticast *multicast, const GNetworkIpAddress *group);
Adds group to the list of groups that multicast is on. If multicast is already connected, groupwill be joined immediately. Otherwise, it will be joined after multicast connects.
multicast : | the multicast object to modify. |
group : | the address of the group to join. |
Since 1.0
void gnetwork_ip_multicast_leave_group (GNetworkIpMulticast *multicast, const GNetworkIpAddress *group);
Removes group from the list of groups multicast is on. If multicast is already connected, the group will be left immediately. Otherwise, group will be removed from the list of groups to join after multicast connects.
multicast : | the multicast object to modify. |
group : | the address of the group to leave. |
Since 1.0
void gnetwork_ip_multicast_clear_groups (GNetworkIpMulticast *multicast);
Clears the list of groups multicast is on. If multicast is connected, the groups will be left immediately. Otherwise, the list of groups to join after multicast connects will be cleared.
multicast : | the multicast object to modify. |
Since 1.0
"multicast-groups" GValueArray : Read
A value array of the IP addresses of groups this socket has joined to when open.
"multicast-ttl" GNetworkUdpDatagramTtl : Read / Write / Construct
The distance multicast messages sent through this datagram should travel.
Default value: GNETWORK_UDP_DATAGRAM_TTL_DEFAULT
<< GNetworkUdpDatagram | Error Reporting >> |