Package org.jgroups.protocols
Class BPING
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.PING
org.jgroups.protocols.BPING
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.Responses -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected InetAddressprotected intprotected Threadprotected DatagramSocketFields inherited from class org.jgroups.protocols.PING
discovery_receptionFields inherited from class org.jgroups.protocols.Discovery
group_addr, local_addr, members, ping_responses, rank, timer, view -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidinit()Called after instance has been created (null constructor) and before protocol is started.voidrun()voidsetBindPort(int bind_port) voidstart()This method is called on aChannel.connect(String).voidstop()This method is called on aChannel.disconnect().Methods inherited from class org.jgroups.protocols.PING
sendGetMembersRequest, up, waitForDiscoveryRequestReceptionMethods inherited from class org.jgroups.protocols.Discovery
discoveryRequestReceived, down, findAllMembers, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, getView, handleConnect, handleDisconnect, makeView, providedUpServices, resetStats, setNumInitialMembers, setNumPingRequests, setTimeoutMethods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProperties, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setErgonomics, setId, setLevel, setProperties, setPropertiesInternal, setProperty, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, upThreadEnabled
-
Field Details
-
dest
-
bind_port
protected int bind_port -
port_range
protected int port_range -
sock
-
receiver
-
dest_addr
-
-
Constructor Details
-
BPING
public BPING()
-
-
Method Details
-
getBindPort
public int getBindPort() -
setBindPort
public void setBindPort(int bind_port) -
init
Description copied from class:ProtocolCalled after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent. -
start
Description copied from class:ProtocolThis method is called on aChannel.connect(String). Starts work. Protocols are connected and queues are ready to receive events. Will be called from bottom to top. This call will replace the START and START_OK events.- Overrides:
startin classDiscovery- Throws:
Exception- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, soChannel.connect(String)will throw an exception
-
stop
public void stop()Description copied from class:ProtocolThis method is called on aChannel.disconnect(). Stops work (e.g. by closing multicast socket). Will be called from top to bottom. This means that at the time of the method invocation the neighbor protocol below is still working. This method will replace the STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that when this method is called all messages in the down queue will have been flushed -
run
public void run()
-