public class MulticastReceiver extends Object implements IMulticastReceiver
Modifier and Type | Field and Description |
---|---|
static int |
PACKET_MAXSIZE |
Constructor and Description |
---|
MulticastReceiver() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
drop(MulticastGroup feed)
Drops (and closes) attached feed.
|
MulticastGroup |
join(InetSocketAddress group,
NetworkInterface nif,
MulticastListener listener)
Short version of join with default buffer size
|
MulticastGroup |
join(InetSocketAddress group,
NetworkInterface nif,
MulticastListener listener,
int bufferSize)
Creates a feed and send a join request.
|
MulticastGroup |
join(String groupId,
int port,
NetworkInterface nif,
MulticastListener listener)
Short version of join with default buffer size
|
MulticastGroup |
join(String groupId,
int port,
NetworkInterface nif,
MulticastListener listener,
int bufferSize)
Creates a feed and send a join request.
|
boolean |
step()
process one step of receiving.
|
public static final int PACKET_MAXSIZE
public MulticastReceiver() throws IOException
IOException
public MulticastGroup join(String groupId, int port, NetworkInterface nif, MulticastListener listener)
Short version of join with default buffer size
This method is equivalent to:
join(groupId, port, nif, listener, MulticastReceiver.PACKET_MAXSIZE);
join
in interface IMulticastReceiver
groupId
- a multicast address to joinport
- port number where to receive UDP packetsnif
- The network interface on which to join the grouplistener
- of the MulticastGroup events.public MulticastGroup join(String groupId, int port, NetworkInterface nif, MulticastListener listener, int bufferSize)
join
in interface IMulticastReceiver
groupId
- a multicast address to joinport
- port number where to receive UDP packetsnif
- The network interface on which to join the grouplistener
- listener of the MulticastGroup events.bufferSize
- max packet size for this multicast grouppublic MulticastGroup join(InetSocketAddress group, NetworkInterface nif, MulticastListener listener, int bufferSize)
This implementation creates a new handler to receive, and puts it into
join queue. All such requests will be proceed in step()
method
join
in interface IMulticastReceiver
group
- a multicast address to join with UDP port Numbernif
- The network interface on which to join the grouplistener
- of the MulticastGroup events.bufferSize
- buffer size for UDP packets of the corresponded grouppublic MulticastGroup join(InetSocketAddress group, NetworkInterface nif, MulticastListener listener)
Short version of join with default buffer size
This method is equivalent to:
join(group, nif, listener, MulticastReceiver.PACKET_MAXSIZE);
Creates a feed and send a join request.join
in interface IMulticastReceiver
group
- a multicast address to join with UDP port Numbernif
- The network interface on which to join the grouplistener
- of the MulticastGroup events.public void drop(MulticastGroup feed)
drop
in interface IMulticastReceiver
feed
- feed to drop from receiving multicastpublic boolean step()
step
in interface IMulticastReceiver
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2005–2024 Onix Solutions. All rights reserved.