PollItem

A structure that specifies a socket to be monitored by $(FREF poll) as well as the events to poll for, and, when $(FREF poll) returns, the events that occurred.

Warning: PollItem objects do not store $(STDREF socket,Socket) references, only the corresponding native file descriptors. This means that the references have to be stored elsewhere, or the objects may be garbage collected, invalidating the sockets before or while $(FREF poll) executes.

// Not OK
auto p1 = PollItem(new std.socket.Socket(/*...*/), PollFlags.pollIn);

// OK
auto s = new std.socket.Socket(/*...*/);
auto p2 = PollItem(s, PollFlags.pollIn);
More...

Constructors

this
this(zmqd.Socket socket, PollFlags events)

Constructs a PollItem for monitoring a $(ZMQ) socket.

this
this(std.socket.Socket socket, PollFlags events)

Constructs a PollItem for monitoring a standard socket referenced by a $(STDREF socket,Socket).

this
this(FD fd, PollFlags events)

Constructs a PollItem for monitoring a standard socket referenced by a native file descriptor.

Members

Properties

requestedEvents
PollFlags requestedEvents [@property setter]
PollFlags requestedEvents [@property getter]

Requested _events.

returnedEvents
PollFlags returnedEvents [@property getter]

Returned events.

Detailed Description

Corresponds to

$(ZMQAPI zmq_poll,zmq_pollitem_t)

Meta