C# Class NetMQ.Poller

Inheritance: IDisposable
ファイルを表示 Open project: NetMQ/NetMQ3-x Class Usage Examples

Private Properties

Property Type Description
Cancel void
INetMQPoller void
INetMQPoller void
ISocketPollableCollection void
OnSocketEventsChanged void
PollWhile void
RebuildPollset void
Start void
Stop void
Stop void
TicklessTimer int

Public Methods

Method Description
AddPollInSocket ( [ socket, [ callback ) : void

Add the given socket and Action to this Poller's collection of socket/actions.

AddSocket ( [ socket ) : void

Add the given socket to this Poller's list.

AddTimer ( [ timer ) : void

Add the given timer to this Poller's list.

Cancel ( ) : void

Cancel the poller job when PollTillCancelled is called

CancelAndJoin ( ) : void

Cancel the poller job when PollTillCancelled is called and wait for the PollTillCancelled to complete

ContainsSocket ( NetMQSocket socket ) : bool

Gets whether socket has been added to this Poller.

Dispose ( ) : void

Perform any freeing, releasing or resetting of contained resources. If this poller is already started, signal the polling thread to stop - and block to wait for it.

Calling this again after the first time, does nothing.

PollOnce ( ) : void

Poll one time.

PollTillCancelled ( ) : void

Poll till Cancel or CancelAndJoin is called. This is a blocking method.

PollTillCancelledNonBlocking ( ) : void

The non blocking version of PollTillCancelled, starting the PollTillCancelled on new thread. Will poll till Cancel or CancelAndJoin is called. This method is not blocking.

Poller ( ) : System

Create a new Poller object, with a default PollTimeout of 1 second.

RemoveAllSockets ( ) : void

Delete all sockets from this Poller's list.

RemoveAllTimers ( ) : void

Remove all timers from this Poller's list.

RemovePollInSocket ( [ socket ) : void

Delete the given socket from this Poller's collection of socket/actions.

RemoveSocket ( [ socket ) : void

Delete the given socket from this Poller's list.

RemoveTimer ( [ timer ) : void

Delete the given timer from this Poller's list.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Perform any freeing, releasing or resetting of contained resources. If this poller is already started, signal the polling thread to stop - and block to wait for it.

Private Methods

Method Description
Cancel ( bool waitForCloseToComplete ) : void

Signal this poller to stop, and return immediately if waitForCloseToComplete is false, block until the poller has actually stopped if waitForCloseToComplete is true.

INetMQPoller ( ) : void
INetMQPoller ( ISocketPollable socket ) : void
ISocketPollableCollection ( ISocketPollable socket ) : void
OnSocketEventsChanged ( object sender, NetMQSocketEventArgs e ) : void

Handle the EventsChanged event of any of the sockets contained within this Poller, by marking this poller as "dirty" in order to reset the poll events.

PollWhile ( [ condition ) : void

Poll as long as the given Func evaluates to true.

RebuildPollset ( ) : void
Start ( ) : void
Stop ( ) : void
Stop ( bool waitForCloseToComplete ) : void
TicklessTimer ( ) : int

Return the soonest timeout value of all the timers in the list, or zero to indicate any of them have already elapsed. The timeout is in milliseconds from now.

Method Details

AddPollInSocket() public method

Add the given socket and Action to this Poller's collection of socket/actions.
socket and callback must not be null. The socket must not have already been added to this poller. This poller must not have already been disposed.
public AddPollInSocket ( [ socket, [ callback ) : void
socket [ the Socket to add
callback [ the Action to add
return void

AddSocket() public method

Add the given socket to this Poller's list.
socket must not be null. socket must not have already been added to this poller. This poller must not have already been disposed.
public AddSocket ( [ socket ) : void
socket [ the ISocketPollable to add to the list
return void

AddTimer() public method

Add the given timer to this Poller's list.
timer must not be null. This poller must not have already been disposed.
public AddTimer ( [ timer ) : void
timer [ the NetMQTimer to add to the list
return void

Cancel() public method

Cancel the poller job when PollTillCancelled is called
public Cancel ( ) : void
return void

CancelAndJoin() public method

Cancel the poller job when PollTillCancelled is called and wait for the PollTillCancelled to complete
public CancelAndJoin ( ) : void
return void

ContainsSocket() public method

Gets whether socket has been added to this Poller.
public ContainsSocket ( NetMQSocket socket ) : bool
socket NetMQSocket
return bool

Dispose() public method

Perform any freeing, releasing or resetting of contained resources. If this poller is already started, signal the polling thread to stop - and block to wait for it.
Calling this again after the first time, does nothing.
public Dispose ( ) : void
return void

Dispose() protected method

Perform any freeing, releasing or resetting of contained resources. If this poller is already started, signal the polling thread to stop - and block to wait for it.
protected Dispose ( bool disposing ) : void
disposing bool true if releasing managed resources
return void

PollOnce() public method

Poll one time.
public PollOnce ( ) : void
return void

PollTillCancelled() public method

Poll till Cancel or CancelAndJoin is called. This is a blocking method.
public PollTillCancelled ( ) : void
return void

PollTillCancelledNonBlocking() public method

The non blocking version of PollTillCancelled, starting the PollTillCancelled on new thread. Will poll till Cancel or CancelAndJoin is called. This method is not blocking.
public PollTillCancelledNonBlocking ( ) : void
return void

Poller() public method

Create a new Poller object, with a default PollTimeout of 1 second.
public Poller ( ) : System
return System

RemoveAllSockets() public method

Delete all sockets from this Poller's list.
This poller must not have already been disposed.
public RemoveAllSockets ( ) : void
return void

RemoveAllTimers() public method

Remove all timers from this Poller's list.
This poller must not have already been disposed.
public RemoveAllTimers ( ) : void
return void

RemovePollInSocket() public method

Delete the given socket from this Poller's collection of socket/actions.
socket must not be null. This poller must not have already been disposed.
public RemovePollInSocket ( [ socket ) : void
socket [ the Socket to remove
return void

RemoveSocket() public method

Delete the given socket from this Poller's list.
socket must not be null. This poller must not have already been disposed.
public RemoveSocket ( [ socket ) : void
socket [ the ISocketPollable to remove from the list
return void

RemoveTimer() public method

Delete the given timer from this Poller's list.
timer must not be null. This poller must not have already been disposed.
public RemoveTimer ( [ timer ) : void
timer [ the NetMQTimer to remove from the list
return void