static void DefaultInquiredEventHandler(object sender, InquiredEventArgs e)
 {
     (sender as IMessagingSocket).StartResponse (e, ((string)e.InquireMessage) + ":Responsed");
 }
Exemple #2
0
 void Inquired_PortCheckStartMessage(object sender, InquiredEventArgs args)
 {
     NodeHandle[] nodes = _kbr.RoutingAlgorithm.GetRandomNodes (CheckRequestSendNodes);
     if (nodes == null || nodes.Length == 0) {
         _msock.StartResponse (args, new PortCheckResponse ());
     } else {
         _msock.StartResponse (args, ACK);
         PortCheckRequest req = new PortCheckRequest (args.EndPoint);
         for (int i = 0; i < nodes.Length; i ++)
             _msock.BeginInquire (req, nodes[i].EndPoint, null, null);
     }
 }
Exemple #3
0
 void Inquired_PortCheckRequest(object sender, InquiredEventArgs args)
 {
     _msock.StartResponse (args, ACK);
     _msock.BeginInquire (new PortCheckResponse (), (args.InquireMessage as PortCheckRequest).EndPoint, null, null);
 }
Exemple #4
0
        void Inquired_PortCheckResponse(object sender, InquiredEventArgs args)
        {
            _msock.StartResponse (args, ACK);
            lock (_eps) {
                if (_sentEPs.Contains (args.EndPoint))
                    return; // ignore
            }

            Success ();
        }
Exemple #5
0
 void InquiredStringMessage(object sender, InquiredEventArgs e)
 {
     IMessagingSocket msock = sender as IMessagingSocket;
     string msg = ((string)e.InquireMessage) + "-" + SubscribeKey + "-ok";
     msock.StartResponse (e, msg);
 }