Esempio n. 1
0
        /// <summary>
        /// Add a socket that will be polled for input/output events, depending on its capabilities.
        /// </summary>
        /// <param name="socket">The <see cref="ZmqSocket"/> to poll.</param>
        public void AddSocket(ZmqSocket socket)
        {
            if (socket == null)
            {
                throw new ArgumentNullException("socket");
            }

            _pollableSockets.Add(new PollItem(socket.SocketHandle, socket.GetPollEvents()), socket);
        }
Esempio n. 2
0
        /// <summary>
        /// Add a socket that will be polled for input/output events, depending on its capabilities.
        /// </summary>
        /// <param name="socket">The <see cref="ZmqSocket"/> to poll.</param>
        /// <exception cref="ArgumentNullException"><paramref name="socket"/> is null.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="socket"/> has no event handlers.</exception>
        public void AddSocket(ZmqSocket socket)
        {
            if (socket == null)
            {
                throw new ArgumentNullException("socket");
            }

            var pollEvents = socket.GetPollEvents();

            if (pollEvents == PollEvents.None)
            {
                throw new ArgumentOutOfRangeException("socket", "Unable to add socket without at least one handler.");
            }

            _pollableSockets.Add(new PollItem(socket.SocketHandle, pollEvents), socket);
        }