Hi everyone,
Recently I am learning to use the Broker-Enabled Communication Framework. When I tried to run an example in the document, I encountered a problem saying "value used but not set". Might be a silly question, but anyone have any idea?
Here is my codes:
const broker_port: port = 9999/tcp &redef;
redef exit_only_after_terminate = T;
redef Broker::endpoint_name = "connector";
global my_auto_event: event(msg: string, c: count);
event bro_init()
{
Broker::enable();
Broker::connect("127.0.0.1", broker_port, 1sec);
Broker::auto_event("bro/event/my_auto_event", my_auto_event);
}
event Broker::outgoing_connection_established(peer_address: string,
peer_port: port,
peer_name: string)
{
print "Broker::outgoing_connection_established",
peer_address, peer_port, peer_name;
event my_auto_event("stuff", 88);
event my_auto_event("more stuff", 51);
}
event Broker::outgoing_connection_broken(peer_address: string,
peer_port: port)
{
terminate();
}
And here is the problem:
bro events_connector.bro
error in ./events_connector.bro, line 8: value used but not set (Broker::enable)
error in ./events_connector.bro, line 9: value used but not set (Broker::connect)
error in ./events_connector.bro, line 10: value used but not set (Broker::auto_event)
Thanks a lot.
Wenyu