Class 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
    • Constructor Detail

    • Method Detail

      • join

        public MulticastGroup join​(InetSocketAddress group,
                                   NetworkInterface nif,
                                   MulticastListener listener,
                                   int bufferSize)
        Description copied from class: MulticastReceiver
        Creates 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:
        join in interface IMulticastReceiver
        Overrides:
        join in class MulticastReceiver
        Parameters:
        group - a multicast address to join with UDP port Number
        nif - The network interface on which to join the group
        listener - 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:
        drop in interface IMulticastReceiver
        Overrides:
        drop in class MulticastReceiver
        Parameters:
        feed - a feed
      • step

        public boolean step()
        Description copied from class: MulticastReceiver
        process 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:
        step in interface IMulticastReceiver
        Overrides:
        step in class MulticastReceiver
        Returns:
        false if MulticastReceiver cannot work farther and must be closed, true if everything going well