示例#1
0
		public PollItem(PollingEvents events, Socket socket)
		{
			_socket = socket;
			var flags = (Int16)events;

			if (!Context.IsMono && Environment.Is64BitProcess)
			{
				this.Item64 = new Native.Poll.zmq_pollitem_t_x64()
				{
					socket = socket.Handle(),
					events = flags
				};
			}
			else
			{
				this.Item32 = new Native.Poll.zmq_pollitem_t_x86()
				{
					socket = socket.Handle(),
					events = flags
				};
			}
		}
示例#2
0
		public Polling(PollingEvents events, params Socket[] sockets)
			: this(BuildPollItems(events, sockets))
		{
		}
示例#3
0
		public Polling(PollingEvents events, params IZmqSocket[] sockets)
			: this(BuildPollItems(events, sockets.Cast<Socket>().ToArray()))
		{
		}
示例#4
0
		private static PollItem[] BuildPollItems(PollingEvents events, Socket[] sockets)
		{
			var items = new PollItem[sockets.Length];

			for (int i = 0; i < items.Length; i++)
			{
				items[i] = new PollItem(events, sockets[i]);
			}

			return items;
		}