Пример #1
0
		public Polling(PollItem[] items)
		{
			this._items = items;

			if (!Context.IsMono && Environment.Is64BitProcess)
				_items_x64 = new Native.Poll.zmq_pollitem_t_x64[items.Length];
			else
				_items_x86 = new Native.Poll.zmq_pollitem_t_x86[items.Length];

			// caching the ptr (which shouldnt change since they are unmanaged)
			for (int i = 0; i < items.Length; i++)
			{
				var pollItem = items[i];

				if (!Context.IsMono && Environment.Is64BitProcess)
				{
					_items_x64[i] = pollItem.Item64;
					_ptr2Socket[pollItem.Item64.socket] = pollItem._socket;
				}
				else
				{
					_items_x86[i] = pollItem.Item32;
					_ptr2Socket[pollItem.Item32.socket] = pollItem._socket;
				}
			}
		}
Пример #2
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);
        }
Пример #3
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;
		}