NetMQ.Core.SocketBase.GetSocketOption C# (CSharp) Method

GetSocketOption() public method

Return the integer-value of the specified option.
If the ReceiveMore option is specified, then 1 is returned if it is true, 0 if it is false. If the Events option is specified, then process any outstanding commands, and return -1 if that throws a TerminatingException. then return an integer that is the bitwise-OR of the PollEvents.PollOut and PollEvents.PollIn flags. Otherwise, cast the specified option value to an integer and return it.
The socket has been stopped.
public GetSocketOption ( ZmqSocketOption option ) : int
option ZmqSocketOption which option to get
return int
        public int GetSocketOption(ZmqSocketOption option)
        {
            CheckContextTerminated();

            if (option == ZmqSocketOption.ReceiveMore)
            {
                return m_rcvMore ? 1 : 0;
            }
            if (option == ZmqSocketOption.Events)
            {
                try
                {
                    ProcessCommands(0, false);
                }
                catch (TerminatingException)
                {
                    return -1;
                }

                PollEvents val = 0;
                if (HasOut())
                    val |= PollEvents.PollOut;
                if (HasIn())
                    val |= PollEvents.PollIn;
                return (int)val;
            }

            return (int)GetSocketOptionX(option);
        }