Exemple #1
0
		public override RegisterResponseInfo Register (RegisterInfo registerInfo)
		{
			Node n = new Node ();
			RegisterResponseInfo rri;
			
			if (ControlShape)
			{
				lock (mesh_lock)
				{
					Guid guid = Guid.NewGuid ();
					n.RegistrationId = guid;
					n.Address = registerInfo.NodeAddress;
					n.ClientId = registerInfo.ClientId;
					Console.WriteLine ("Register: {0}", n.ClientId);
					
					if (nodes_count == 0)
						unique_node = n;
					
					nodes_count ++;
					rri = new RegisterResponseInfo (n.RegistrationId, TimeSpan.MaxValue);
				}
			}
			else
				rri = base.Register (registerInfo);
			
			return rri;
		}
Exemple #2
0
		public override void Unregister (UnregisterInfo unregisterInfo)
		{
			if (ControlShape)
			{
				lock (mesh_lock) {
					if (nodes_count == 1) {
						unique_node = null;
						nodes_count --;
					}
					
					Console.WriteLine ("Unregister");
				}
			}
			else
				base.Unregister (unregisterInfo);
		}