Package biz.onixs.util.network
Class MulticastFastThreadReceiver
- java.lang.Object
-
- biz.onixs.util.network.MulticastReceiver
-
- biz.onixs.util.network.MulticastThreadReceiver
-
- biz.onixs.util.network.MulticastFastThreadReceiver
-
- All Implemented Interfaces:
IMulticastReceiver,Closeable,AutoCloseable
public class MulticastFastThreadReceiver extends MulticastThreadReceiver
According to Serge Matskov requirements, there is a "fast" version of MulticastThreadReceiver. Differences: join(...) works only before thread starts. There is no join/drop queue and corresponding processing in void step() anymore drop(feed) doesn't work. step() implementation will only check Channel status, no dynamic adds/removes anymore- Author:
- vmelnyk
-
-
Field Summary
-
Fields inherited from class biz.onixs.util.network.MulticastReceiver
PACKET_MAXSIZE
-
-
Constructor Summary
Constructors Constructor Description MulticastFastThreadReceiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrop(MulticastGroup feed)Does nothing: before start thread there is no point to call, when thread is running it cannot be removed, when thread is already stopped, it will receive nothingMulticastGroupjoin(InetSocketAddress group, NetworkInterface nif, MulticastListener listener, int bufferSize)Creates a feed and send a join request.booleanstep()process one step of receiving.-
Methods inherited from class biz.onixs.util.network.MulticastThreadReceiver
close, getThread, interrupt, start
-
Methods inherited from class biz.onixs.util.network.MulticastReceiver
join, join, join
-
-
-
-
Constructor Detail
-
MulticastFastThreadReceiver
public MulticastFastThreadReceiver() throws IOException- Throws:
IOException
-
-
Method Detail
-
join
public MulticastGroup join(InetSocketAddress group, NetworkInterface nif, MulticastListener listener, int bufferSize)
Description copied from class:MulticastReceiverCreates a feed and send a join request.This implementation creates a new handler to receive, and puts it into join queue. All such requests will be proceed in
MulticastReceiver.step()method- Specified by:
joinin interfaceIMulticastReceiver- Overrides:
joinin classMulticastReceiver- Parameters:
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 group- Returns:
- created MulticastGroup to receive multicast group messages
-
drop
public void drop(MulticastGroup feed)
Does nothing: before start thread there is no point to call, when thread is running it cannot be removed, when thread is already stopped, it will receive nothing- Specified by:
dropin interfaceIMulticastReceiver- Overrides:
dropin classMulticastReceiver- Parameters:
feed- a feed
-
step
public boolean step()
Description copied from class:MulticastReceiverprocess one step of receiving. It's: 1. Adds all feeds added by join function 2. Drops/removes feeds from drop list 3. Proceeds all opened connections- Specified by:
stepin interfaceIMulticastReceiver- Overrides:
stepin classMulticastReceiver- Returns:
- false if MulticastReceiver cannot work farther and must be closed, true if everything going well
-
-