protected void EnqueueHandler(object queue, EventArgs arg) {
Channel q = (Channel)queue;
RpcResult rpc_res = null;
try {
rpc_res = (RpcResult)q.Dequeue();
ConnectToMessage new_ctm = new ConnectToMessage( (IDictionary)rpc_res.Result );
if(_local_node.Address.Equals(new_ctm.Target.Address)) {
throw new Exception("Trying to connect to myself!");
}
lock( _sync ) {
/**
* It is the responsibilty of the ConnectionOverlord
* to deal with this ctm
*/
_got_ctms.Add(new_ctm);
}
bool close_queue = _co.HandleCtmResponse(this, rpc_res.ResultSender, new_ctm);
if( close_queue ) {
q.Close();
}
}
catch(Exception) {
//This can happen if the queue is empty and closed. Don't do
//anything.
}
}
/**