示例#1
0
            addCallback(Reference @ref, Reference wellKnownRef, int ttl, GetEndpointsCallback cb)
            {
                RequestCallback callback = new RequestCallback(@ref, ttl, cb);

                lock (this)
                {
                    if (!_response && _exception == null)
                    {
                        _callbacks.Add(callback);
                        if (wellKnownRef != null)
                        {
                            // This request is to resolve the endpoints of a cached well-known object ref
                            _wellKnownRefs.Add(wellKnownRef);
                        }
                        if (!_sent)
                        {
                            _sent = true;
                            send();
                        }
                        return;
                    }
                }

                if (_response)
                {
                    callback.response(_locatorInfo, _proxy);
                }
                else
                {
                    Debug.Assert(_exception != null);
                    callback.exception(_locatorInfo, _exception);
                }
            }
示例#2
0
 addCallback(Reference @ref, Reference wellKnownRef, int ttl, GetEndpointsCallback cb)
 {
     _m.Lock();
     try
     {
         RequestCallback callback = new RequestCallback(@ref, ttl, cb);
         if (_response)
         {
             callback.response(_locatorInfo, _proxy);
         }
         else if (_exception != null)
         {
             callback.exception(_locatorInfo, _exception);
         }
         else
         {
             _callbacks.Add(callback);
             if (wellKnownRef != null)
             {
                 // This request is to resolve the endpoints of a cached well-known object ref
                 _wellKnownRefs.Add(wellKnownRef);
             }
             if (!_sent)
             {
                 _sent = true;
                 send(true);
             }
         }
     }
     finally
     {
         _m.Unlock();
     }
 }
示例#3
0
 addCallback(Reference @ref, Reference wellKnownRef, int ttl, GetEndpointsCallback cb)
 {
     _m.Lock();
     try
     {
         RequestCallback callback = new RequestCallback(@ref, ttl, cb);
         if(_response)
         {
             callback.response(_locatorInfo, _proxy);
         }
         else if(_exception != null)
         {
             callback.exception(_locatorInfo, _exception);
         }
         else
         {
             _callbacks.Add(callback);
             if(wellKnownRef != null) 
             {
                 // This request is to resolve the endpoints of a cached well-known object ref
                 _wellKnownRefs.Add(wellKnownRef);
             }
             if(!_sent)
             {
                 _sent = true;
                 send(true);
             }
         }
     }
     finally
     {
         _m.Unlock();
     }
 }
示例#4
0
            public void addCallback(Reference @ref, Reference wellKnownRef, int ttl, GetEndpointsCallback cb)
            {
                RequestCallback callback = new RequestCallback(@ref, ttl, cb);
                lock(this)
                {
                    if(!_response && _exception == null)
                    {
                        _callbacks.Add(callback);
                        if(wellKnownRef != null)
                        {
                            // This request is to resolve the endpoints of a cached well-known object ref
                            _wellKnownRefs.Add(wellKnownRef);
                        }
                        if(!_sent)
                        {
                            _sent = true;
                            send();
                        }
                        return;
                    }
                }

                if(_response)
                {
                    callback.response(_locatorInfo, _proxy);
                }
                else
                {
                    Debug.Assert(_exception != null);
                    callback.exception(_locatorInfo, _exception);
                }
            }