zeek/doc/frameworks/comm/printing-connector.bro
Jon Siwek 8d19bf6381 broker integration: add high-level usage documentation
i.e. documentation of the new "comm framework" w/ examples.
2015-02-18 12:16:46 -06:00

26 lines
746 B
Text

const broker_port: port &redef;
redef exit_only_after_terminate = T;
redef Comm::endpoint_name = "connector";
event bro_init()
{
Comm::enable();
Comm::connect("127.0.0.1", broker_port, 1sec);
}
event Comm::outgoing_connection_established(peer_address: string,
peer_port: port,
peer_name: string)
{
print "Comm::outgoing_connection_established",
peer_address, peer_port, peer_name;
Comm::print("bro/print/hi", "hello");
Comm::print("bro/print/stuff", "...");
Comm::print("bro/print/bye", "goodbye");
}
event Comm::outgoing_connection_broken(peer_address: string,
peer_port: port)
{
terminate();
}