protected void GetVivaldiState() {
#if NC_DEBUG
Console.Error.WriteLine("[NCService] {0} Requesting vivaldi state from: {1}.", _node.Address, _target.Address);
#endif
Channel q = new Channel(1);
q.CloseEvent += delegate(object o, EventArgs args) {
Channel nc_q = (Channel) o;
if (nc_q.Count > 0) {
try {
RpcResult result = nc_q.Dequeue() as RpcResult;
_state_result.Value = (Hashtable) result.Result;
} catch(Exception) {}
}
//if got something valid, move on to Step 2.
if (_state_result.Value != null) {
GetLatencySample();
}
else {
//do nothing, looks like things are not going well with this trial
//termination
#if NC_DEBUG
Console.Error.WriteLine("[NCService] {0} Rpc (GetVivaldiState) failed: {1}.", _node.Address, _target.Address);
#endif
}
};
try {
_node.Rpc.Invoke(_target.State.Edge, q, "ncserver.EchoVivaldiState", new object[]{});
} catch(Exception) {}
}