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

GetSocketOptionX() public method

Return the value of the specified option as an Object.
If the Handle option is specified, then return the handle of the contained mailbox. If the Events option is specified, then process any outstanding commands, and return -1 if that throws a TerminatingException. then return a PollEvents that is the bitwise-OR of the PollEvents.PollOut and PollEvents.PollIn flags.
The socket has already been stopped.
public GetSocketOptionX ( ZmqSocketOption option ) : object
option ZmqSocketOption which option to get
return object
        public object GetSocketOptionX(ZmqSocketOption option)
        {
            CheckContextTerminated();

            if (option == ZmqSocketOption.ReceiveMore)
            {
                return m_rcvMore;
            }

            if (option == ZmqSocketOption.Handle)
            {
                return m_mailbox.Handle;
            }

            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 val;
            }
            // If the socket type doesn't support the option, pass it to
            // the generic option parser.
            return m_options.GetSocketOption(option);
        }