ROEventReceiver

Overview

The ROEventReceiver class is a server callback events receiver implementation for OS X platform.

Notice
ROEventReceiver object can not be released while active because it spawns a NSThread that keeps the reference to the receiver object itself. So calling release from user level code does not stop the working receiver and does not free the memory.

Location

 

active  protected assign

Turns the event receiving on or off.

@property (assign) BOOL active

adjustPollInterval  protected assign

If set to YES allows the receiver to variate the time interval between event requests.

@property (assign) BOOL adjustPollInterval

channel  protected retain

References the channel which is used to poll for events. It is recommended to use a separate channel for the event receiver to avoid collisions as polling for events is performed asynchronously in background.

@property (retain) ROClientChannel *channel

currentPollInterval  protected

Allows to get the current poll interval, the value may vary if the adjustPollInterval is set to YES. Otherwise it is equal to the minimumPollInterval property value.

@property (readonly) int currentPollInterval

delegate  protected retain

References the delegate object that should conform to ROEventReceiverDelegate protocol.

@property (retain) id delegate

initWithChannel:message:  protected

Initializes the class instance and assigns channel and message properties.

- (id) initWithChannel:(ROClientChannel *)aChannel message:(ROMessage *)aMessage

Parameters:

  • aChannel: The channel to use to communicate with the server.
  • aMessage: The message to use to communicate with the server.

invokeInBackground  protected assign

@property (assign) BOOL invokeInBackground

isAnyHandlerRegistered:  protected

Allows to check if any event handlers registered to handle events with the specified event sink name.

- (BOOL) isAnyHandlerRegistered:(NSString *)aEvents

Parameters:

  • aEvents: The event sink name.

isHandlerRegistered:forEvents:  protected

Allows to check if the specified object is registered as event handler for events with the specified event sink name.

- (BOOL) isHandlerRegistered:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to check.
  • aEvents: The event sink name.

maximumMessagesPerPoll  protected assign

Allows to specify the maximum number of event messages that can be received with one event request call. If the number of event messages on the server exceeds this value then remaining messages will be downloaded during subsequent event request(s).

@property (assign) int maximumMessagesPerPoll

maximumPollIntrval  protected assign

Specifies the maximum interval between event requests in seconds. This property is used only when adjustPollInterval is set to YES.

@property (assign) int maximumPollIntrval

message  protected retain

References the message class instance to be used for server communication.

@property (retain) ROMessage *message

minimumPollInterval  protected assign

Specifies the minimum interval between event requests in seconds when adjustPollInterval property is set to YES. Or specifies the constant poll interval otherwise. NOTE: because the poll interval variation is not implemented yet use this property to change the poll interval as needed.

@property (assign) int minimumPollInterval

registerEventHandler:  protected

- (void) registerEventHandler:(id)aHandler

Parameters:

  • aHandler:

registerEventHandler:forEvents:  protected deprecated

Registers the object to be an event handler for events with the specified event sink name.

- (void) registerEventHandler:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to register as an event handler.
  • aEvents: The event sink name.

registerEventHandler:forEventSink:  protected

- (void) registerEventHandler:(id)aHandler forEventSink:(NSString *)eventSinkID

Parameters:

  • aHandler:
  • eventSinkID:

registerEventHandler:forEventSinks:  protected

- (void) registerEventHandler:(id)aHandler forEventSinks:(NSArray *)eventSinkIDs

Parameters:

  • aHandler:
  • eventSinkIDs:

serviceName  protected retain

The name of the remote service to communicate with.

@property (retain) NSString *serviceName

setSynchronizedInvoke:  protected deprecated

- (void) setSynchronizedInvoke:(BOOL)value

Parameters:

  • value:

synchronizedInvoke  protected deprecated

- (BOOL) synchronizedInvoke

unregisterAllEvents:  protected

Cancels registration of the object as a handler of all events it has been registered to handle.

- (void) unregisterAllEvents:(id)aHandler

Parameters:

  • aHandler: The object to unregister.

unregisterAllHandlers:  protected

Cancels handling of all events with the specified event sink name.

- (void) unregisterAllHandlers:(NSString *)aEvents

Parameters:

  • aEvents: The event sink name to cancel handling.

unregisterEventHandler:forEvents:  protected deprecated

Cancels registration of the object as an event handler of all events with the specified event sink name.

- (void) unregisterEventHandler:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to unregister.
  • aEvents: The event sink name to cancel handling.

unregisterEventHandler:forEventSink:  protected

- (void) unregisterEventHandler:(id)aHandler forEventSink:(NSString *)eventSinkID

Parameters:

  • aHandler:
  • eventSinkID:

 

active  protected assign

Turns the event receiving on or off.

@property (assign) BOOL active

adjustPollInterval  protected assign

If set to YES allows the receiver to variate the time interval between event requests.

@property (assign) BOOL adjustPollInterval

channel  protected retain

References the channel which is used to poll for events. It is recommended to use a separate channel for the event receiver to avoid collisions as polling for events is performed asynchronously in background.

@property (retain) ROClientChannel *channel

currentPollInterval  protected

Allows to get the current poll interval, the value may vary if the adjustPollInterval is set to YES. Otherwise it is equal to the minimumPollInterval property value.

@property (readonly) int currentPollInterval

delegate  protected retain

References the delegate object that should conform to ROEventReceiverDelegate protocol.

@property (retain) id delegate

invokeInBackground  protected assign

@property (assign) BOOL invokeInBackground

maximumMessagesPerPoll  protected assign

Allows to specify the maximum number of event messages that can be received with one event request call. If the number of event messages on the server exceeds this value then remaining messages will be downloaded during subsequent event request(s).

@property (assign) int maximumMessagesPerPoll

maximumPollIntrval  protected assign

Specifies the maximum interval between event requests in seconds. This property is used only when adjustPollInterval is set to YES.

@property (assign) int maximumPollIntrval

message  protected retain

References the message class instance to be used for server communication.

@property (retain) ROMessage *message

minimumPollInterval  protected assign

Specifies the minimum interval between event requests in seconds when adjustPollInterval property is set to YES. Or specifies the constant poll interval otherwise. NOTE: because the poll interval variation is not implemented yet use this property to change the poll interval as needed.

@property (assign) int minimumPollInterval

serviceName  protected retain

The name of the remote service to communicate with.

@property (retain) NSString *serviceName

 

initWithChannel:message:  protected

Initializes the class instance and assigns channel and message properties.

- (id) initWithChannel:(ROClientChannel *)aChannel message:(ROMessage *)aMessage

Parameters:

  • aChannel: The channel to use to communicate with the server.
  • aMessage: The message to use to communicate with the server.

isAnyHandlerRegistered:  protected

Allows to check if any event handlers registered to handle events with the specified event sink name.

- (BOOL) isAnyHandlerRegistered:(NSString *)aEvents

Parameters:

  • aEvents: The event sink name.

isHandlerRegistered:forEvents:  protected

Allows to check if the specified object is registered as event handler for events with the specified event sink name.

- (BOOL) isHandlerRegistered:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to check.
  • aEvents: The event sink name.

registerEventHandler:  protected

- (void) registerEventHandler:(id)aHandler

Parameters:

  • aHandler:

registerEventHandler:forEvents:  protected deprecated

Registers the object to be an event handler for events with the specified event sink name.

- (void) registerEventHandler:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to register as an event handler.
  • aEvents: The event sink name.

registerEventHandler:forEventSink:  protected

- (void) registerEventHandler:(id)aHandler forEventSink:(NSString *)eventSinkID

Parameters:

  • aHandler:
  • eventSinkID:

registerEventHandler:forEventSinks:  protected

- (void) registerEventHandler:(id)aHandler forEventSinks:(NSArray *)eventSinkIDs

Parameters:

  • aHandler:
  • eventSinkIDs:

setSynchronizedInvoke:  protected deprecated

- (void) setSynchronizedInvoke:(BOOL)value

Parameters:

  • value:

synchronizedInvoke  protected deprecated

- (BOOL) synchronizedInvoke

unregisterAllEvents:  protected

Cancels registration of the object as a handler of all events it has been registered to handle.

- (void) unregisterAllEvents:(id)aHandler

Parameters:

  • aHandler: The object to unregister.

unregisterAllHandlers:  protected

Cancels handling of all events with the specified event sink name.

- (void) unregisterAllHandlers:(NSString *)aEvents

Parameters:

  • aEvents: The event sink name to cancel handling.

unregisterEventHandler:forEvents:  protected deprecated

Cancels registration of the object as an event handler of all events with the specified event sink name.

- (void) unregisterEventHandler:(id)aHandler forEvents:(NSString *)aEvents

Parameters:

  • aHandler: The object to unregister.
  • aEvents: The event sink name to cancel handling.

unregisterEventHandler:forEventSink:  protected

- (void) unregisterEventHandler:(id)aHandler forEventSink:(NSString *)eventSinkID

Parameters:

  • aHandler:
  • eventSinkID:

See Also

  • Event Sinks and Server Callbacks
  • Event Receivers
  • HTTP Chat sample (Xcode)