public void SetOption(ZContextOption option, int optionValue)
        {
            EnsureNotDisposed();

            int rc = zmq.ctx_set(_contextPtr, (Int32)option, optionValue);

            if (rc == -1)
            {
                var error = ZError.GetLastErr();

                if (error == ZError.EINVAL)
                {
                    throw new ArgumentOutOfRangeException(
                              string.Format("The requested option optionName \"{0}\" is invalid.", option));
                }
                throw new ZException(error);
            }
        }
Beispiel #2
0
        public int GetOption(ZContextOption option)
        {
            EnsureNotDisposed();

            int rc = zmq.ctx_get(_contextPtr, (Int32)option);

            if (rc != -1)
            {
                return(rc);
            }
            var error = ZError.GetLastErr();

            if (Equals(error, ZError.EINVAL))
            {
                throw new ArgumentOutOfRangeException(
                          $"The requested option optionName \"{option}\" is invalid.");
            }
            throw new ZException(error);
        }
Beispiel #3
0
        public void SetOption(ZContextOption option, int optionValue)
        {
            EnsureNotDisposed();

            int rc = zmq.ctx_set(_contextPtr, (Int32)option, optionValue);
            if (rc == -1)
            {
                var error = ZError.GetLastErr();

                if (error == ZError.EINVAL)
                {
                    throw new ArgumentOutOfRangeException(
                        string.Format("The requested option optionName \"{0}\" is invalid.", option));
                }
                throw new ZException(error);
            }
        }