Inherits from NSObject
Declared in MSFKFlintChannel.h
MSFKFlintChannel.m

Overview

A MSFKFlintChannel is used to send and receive messages that are tagged with a specific namespace. In this way, multiple channels may be multiplexed over a single connection to the device.

Subclasses should implement the @link MSFKFlintChannel#didReceiveTextMessage: @endlink and/or @link MSFKFlintChannel#didReceiveBinaryMessage: @endlink methods to process incoming messages, and will typically provide additional methods for sending messages that are specific to a given namespace.

@ingroup Messages

Properties

protocolNamespace

The channel’s namespace.

@property (nonatomic, copy) NSString *protocolNamespace

Discussion

The channel’s namespace.

Declared In

MSFKFlintChannel.h

Instance Methods

didConnect

Called when this channel is added to a connected handler, or when then disconnected handler to which this channel has been added becomes connected.

- (void)didConnect

Discussion

Called when this channel is added to a connected handler, or when then disconnected handler to which this channel has been added becomes connected.

This implementation updates isConnected, so if subclasses override this method they should call through to the super implementation.

Declared In

MSFKFlintChannel.h

didDisconnect

Called when this channel is removed from a connected handler, or when then connected handler to which this channel has been added becomes disconnected.

- (void)didDisconnect

Discussion

Called when this channel is removed from a connected handler, or when then connected handler to which this channel has been added becomes disconnected.

This implementation updates isConnected, so if subclasses override this method they should call through to the super implementation.

Declared In

MSFKFlintChannel.h

didReceiveTextMessage:

Called when a text message has been received for this channel. The default implementation is a no-op.

- (void)didReceiveTextMessage:(NSString *)textMessage

Parameters

message

The message string.

Discussion

Called when a text message has been received for this channel. The default implementation is a no-op.

Declared In

MSFKFlintChannel.h

generateRequestID

Generates a request ID for a new message.

- (NSInteger)generateRequestID

Discussion

Generates a request ID for a new message.

Declared In

MSFKFlintChannel.h

generateRequestNumber

A convenience method which wraps generateRequestID in an NSNumber.

- (NSNumber *)generateRequestNumber

Discussion

A convenience method which wraps generateRequestID in an NSNumber.

Declared In

MSFKFlintChannel.h

initWithNamespace:

Designated initializer. Constructs a new MSFKFlintChannel with the given namespace.

- (id)initWithNamespace:(NSString *)protocolNamespace

Parameters

protocolNamespace

The namespace.

Discussion

Designated initializer. Constructs a new MSFKFlintChannel with the given namespace.

Declared In

MSFKFlintChannel.h

sendTextMessage:

Sends a text message.

- (BOOL)sendTextMessage:(NSString *)textMessage

Parameters

message

The message string.

Return Value

YES on success or NO if the message could not be sent (because the handler is not connected, or because the send buffer is too full at the moment).

Discussion

Sends a text message.

Declared In

MSFKFlintChannel.h