EventReceiver Class

From RemObjects Software

Jump to: navigation, search

This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.



Overview (.NET)

This class is used on the client side to poll and receive events queued on the server.

To enable event polling, you need to drop (or manually create) an instance of this class on your client, and assign a Message and Channel.

Note that because the event polling will happen at regular intervals, regardless of the actions in your main application, it is advisable to provide a separate instance of the Channel component to be used by the EventReceiver.

This way you can be certain that the event polling will not conflict with normal method calls into your service that your application initiates.


Namespace

Declaration (C#)

[System.Drawing.ToolboxBitmap(typeof(RemObjects.SDK.EventReceiver), "Glyphs.EventReceiver.bmp")]
public class EventReceiver : System.ComponentModel.Component, IEventReceiver;

Hierarchy

  • System.ComponentModel.Component
    • RemObjects.SDK.EventReceiver

Properties

Property
Type
Description
Active Boolean Specifies whether the event receiver is currently processing events.
AdjustPollInterval Boolean Specifies whether the EventReceiver should adjust the poll rate according to the level of incoming event messages (true, default) or not (false).

If set to true, the polling interval will be doubled whenever no messages have been received for ten consecutive polls, until the MaximumPollInterval in reached; as soon as one or more messages are received, the interval is set back to the MinimumPollInterval. Every time the interval changes, a OnPollIntervalChanged event gets triggered. If set to false, the EventReceiver will continuously poll at the MinimumPollInterval.

Channel IClientChannel The Channel component used to communicate with the server.

Note: because the event polling will happen at regular intervals, regardless of the actions in your main application, it is advisable to provide a separate instance of the Channel component to be used by the EventReceiver. This way you can be certain that the event polling will not conflict with normal method calls into your service that your application initiates.

CurrentPollInterval Integer Indicates the current poll interval (read-only).
MaximumMessagesPerPoll Integer Specifies the maximum number of messages to receive with one message call (default is 10).

If a poll indicates that more messages have been queued than could be retrieved in a single call, subsequent calls are initiated immediately to receive all messages.

MaximumPollInterval Integer The maximum interval, in milliseconds, that will be used to poll the server (default is 32000, which equals 32 seconds).

If AdjustPollInterval is set to true, the actual poll rate will be increased over time, if no event messages are received. This property specifies the the maximum value that will ever be reached. If AdjustPollRate is set to false, this property has no effect.

Message IMessage The message component used to communicate with the server and to decode the events received from the server.

This must be the same type of message as is used with the EventSinkManager on the server side.

MinimumPollInterval Integer The default interval, in milliseconds, that will be used to poll the server (default is 1000, which equals 1 second).

If AdjustPollInterval is set to true, the actual poll rate will be adjusted at runtime depending on how frequently event messages come in.

SynchronizeControl Control


Methods

Method
Description
Dispatch
Dispose
EventReceiver Default constructor for EventReceiver.
RegisterEventHandler Used to register class to receive events.
UnregisterEventHandler Used to unregister handlers previously registered via RegisterEventHandlers.


Events

Event
Description
OnPollException This event gets fired when an exception occurred during retrieval or processing of an event message (including the case when your event handler method throws an error).
OnPollIntervalChanged This event gets fired whenever the EventReceiver has adjusted the poll interval for incoming messages.


See Also


Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToComponentsToolsSamplesArticlesArchitectureIssues

Personal tools