Package xbot.common.networking
Class ZeromqListener
java.lang.Object
xbot.common.networking.ZeromqListener
- All Implemented Interfaces:
XZeromqListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface xbot.common.networking.XZeromqListener
XZeromqListener.XZeromqListenerFactory
-
Constructor Summary
ConstructorDescriptionZeromqListener
(String connectionString, String topic) This is the wrapper class for the actual ZeroMQ subscriber, based on http://zguide.zeromq.org/java:wuclient and our 2017 ethernet implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setNewPacketHandler
(Consumer<String> handler) void
start()
void
stop()
-
Constructor Details
-
ZeromqListener
@AssistedInject public ZeromqListener(@Assisted("connectionString") String connectionString, @Assisted("topic") String topic) This is the wrapper class for the actual ZeroMQ subscriber, based on http://zguide.zeromq.org/java:wuclient and our 2017 ethernet implementation. It represents the Subscriber half of the Publisher/Subscriber 0MQ model, reading packets as strings.- Parameters:
connectionString
- Typically something like "tcp://localhost:5556"; read the ZeroMQ documentation.topic
- Will filter to messages beginning with this topic. Empty string will read all messages posted ot the given connectionString.
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceXZeromqListener
-
stop
public void stop() -
setNewPacketHandler
- Specified by:
setNewPacketHandler
in interfaceXZeromqListener
-