//Methods:
protected PathELManager(EdgeListener el, bool thread) {
_el = el;
_sync = new object();
_edges = new List<Edge>();
_unannounced = new Dictionary<Edge, PathEdge>();
_pel_map = new Dictionary<string, PathEdgeListener>();
//Use the reqrep protocol with a special prefix:
_rrm = new ReqrepManager("PathELManager:" + el.ToString(), PType.Protocol.Pathing);
_rrm.Subscribe(this, null);
Rpc = new RpcManager(_rrm);
Rpc.AddHandler("sys:pathing", this);
_el.EdgeEvent += HandleEdge;
_running = true;
if(thread) {
_timer_thread = new Thread(
delegate() {
int counter = 0;
int max_counter = EDGE_PERIOD / 1000;
while(_running) {
Thread.Sleep(1000);
ReqrepTimeoutChecker();
if(++counter == max_counter) {
counter = 0;
EdgeTimeoutChecker();
}
}
}
);
_timer_thread.IsBackground = true;
_timer_thread.Start();
}
}