Class ZBeacon
java.lang.Object
org.zeromq.ZBeacon
This class implements a peer-to-peer discovery service for local networks.
A beacon can broadcast and/or capture service announcements using UDP messages
on the local area network. This implementation uses IPv4 UDP broadcasts. You can
define the format of your outgoing beacons, and set a filter that validates incoming
beacons. Beacons are sent and received asynchronously in the background.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfaceAll beacons with matching prefix are passed to a listener. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionZBeacon(int port, byte[] beacon) ZBeacon(String broadcastAddress, byte[] serverAddress, int port, byte[] beacon, long broadcastInterval, boolean ignoreLocalAddress, boolean blocking) Deprecated.ZBeacon(InetAddress broadcastAddress, InetAddress serverAddress, int port, byte[] beacon, long broadcastInterval, boolean ignoreLocalAddress, boolean blocking) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]longbyte[]voidsetBeacon(byte[] beacon) Deprecated.use the buildervoidsetBroadcastInterval(long broadcastInterval) voidsetListener(ZBeacon.Listener listener) Deprecated.use the buildervoidsetPrefix(byte[] prefix) Deprecated.use the buildervoidsetUncaughtExceptionHandlers(Thread.UncaughtExceptionHandler clientExHandler, Thread.UncaughtExceptionHandler serverExHandler) Deprecated.use the buildervoidstart()voidvoidvoidstop()
-
Field Details
-
DEFAULT_BROADCAST_INTERVAL
public static final long DEFAULT_BROADCAST_INTERVAL- See Also:
-
DEFAULT_BROADCAST_HOST
- See Also:
-
-
Constructor Details
-
ZBeacon
public ZBeacon(int port, byte[] beacon) -
ZBeacon
-
ZBeacon
-
ZBeacon
-
ZBeacon
public ZBeacon(InetAddress broadcastAddress, InetAddress serverAddress, int port, byte[] beacon, long broadcastInterval, boolean ignoreLocalAddress, boolean blocking) -
ZBeacon
@Deprecated public ZBeacon(String broadcastAddress, byte[] serverAddress, int port, byte[] beacon, long broadcastInterval, boolean ignoreLocalAddress, boolean blocking) Deprecated.
-
-
Method Details
-
setUncaughtExceptionHandlers
@Deprecated public void setUncaughtExceptionHandlers(Thread.UncaughtExceptionHandler clientExHandler, Thread.UncaughtExceptionHandler serverExHandler) Deprecated.use the builder- Parameters:
clientExHandler-serverExHandler-
-
startClient
public void startClient() -
startServer
public void startServer() -
start
public void start() -
stop
- Throws:
InterruptedException
-
setBeacon
-
getBeacon
public byte[] getBeacon() -
setPrefix
-
getPrefix
public byte[] getPrefix() -
setListener
Deprecated.use the builder- Parameters:
listener-
-
getListener
-
getBroadcastInterval
public long getBroadcastInterval() -
setBroadcastInterval
public void setBroadcastInterval(long broadcastInterval)
-