Package biz.onixs.util.network
Class MulticastGroup
- java.lang.Object
-
- biz.onixs.util.network.MulticastGroup
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MulticastGroup extends Object implements Closeable, AutoCloseable
- Author:
- vmelnyk
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Detaches this feed from MulticastReceiver.intgetBufferSize()InetSocketAddressgetGroup()NetworkInterfacegetIf()MulticastListenergetListener()MulticastReceivergetOwner()returns null if the MulticastGroup is detached (dropped)voidonReceive(byte[] data, int size)Internal use only.
-
-
-
Method Detail
-
getIf
public NetworkInterface getIf()
- Returns:
- network interface for this MulticastGroup
-
getGroup
public InetSocketAddress getGroup()
- Returns:
- group (IP group and port number) which messages will be received by this MulticastGroup
-
getListener
public MulticastListener getListener()
- Returns:
- listener of the feed
-
getBufferSize
public int getBufferSize()
- Returns:
- recommended UDP packet buffer size. a real size can be bigger.
-
onReceive
public void onReceive(byte[] data, int size)Internal use only.onReceive will be called from Connection when its receives a new UDP multicast packet
- Parameters:
data- array that contains UDP packetsize- size of the packet. should be less than data.length
-
getOwner
public MulticastReceiver getOwner()
returns null if the MulticastGroup is detached (dropped)- Returns:
- owner of this feed.
-
close
public void close()
Detaches this feed from MulticastReceiver.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-