Class BPING

  • All Implemented Interfaces:
    java.lang.Runnable, Lifecycle

    public class BPING
    extends PING
    implements java.lang.Runnable
    Broadcast PING. Uses UDP broadcasts to discover initial membership. This protocol is useless in IPv6 environments, as IPv6 has no notion of broadcast addresses. Use IP multicasts instead (e.g. PING or MPING) when running in IPv6.
    Since:
    2.12
    Author:
    Bela Ban
    • Field Detail

      • dest

        protected java.lang.String dest
      • bind_port

        protected int bind_port
      • port_range

        protected int port_range
      • sock

        protected java.net.DatagramSocket sock
      • receiver

        protected volatile java.lang.Thread receiver
      • dest_addr

        protected java.net.InetAddress dest_addr
    • Constructor Detail

      • BPING

        public BPING()
    • Method Detail

      • getBindPort

        public int getBindPort()
      • setBindPort

        public BPING setBindPort​(int bind_port)
      • init

        public void init()
                  throws java.lang.Exception
        Description copied from class: Protocol
        Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.
        Specified by:
        init in interface Lifecycle
        Overrides:
        init in class Discovery
        Throws:
        java.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
      • start

        public void start()
                   throws java.lang.Exception
        Description copied from class: Protocol
        This method is called on a JChannel.connect(String); starts work. Protocols are connected ready to receive events. Will be called from bottom to top.
        Specified by:
        start in interface Lifecycle
        Overrides:
        start in class Discovery
        Throws:
        java.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, so JChannel.connect(String) will throw an exception
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable