コード例 #1
0
        public virtual RegisterResponseInfo Register(RegisterInfo registerInfo)
        {
            if (registerInfo == null)
            {
                throw new ArgumentException("Register info cannot be null.");
            }

            if (!opened)
            {
                throw new InvalidOperationException("The service has never been opened or it was closed previously.");
            }

            return(client.Register(registerInfo));
        }
コード例 #2
0
        public override object Register(string meshId,
                                        PeerNodeAddress nodeAddress, TimeSpan timeout)
        {
            if (String.IsNullOrEmpty(meshId))
            {
                throw new ArgumentNullException("meshId");
            }
            if (nodeAddress == null)
            {
                throw new ArgumentNullException("nodeAddress");
            }
            if (timeout <= TimeSpan.Zero)
            {
                throw new ArgumentException(String.Format("Timeout value must be positive value. It was {0}", timeout));
            }

            client.OperationTimeout = timeout;
            preserved_mesh_id       = meshId;
            return(client.Register(new RegisterInfo(client_id, meshId, nodeAddress)).RegistrationId);
        }