Diffusion Apple API  6.2.7
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Functions Variables Properties Pages
Class Methods | Properties | Instance Methods | List of all members
PTDiffusionSession Class Reference

Introduction

A session represents a single connection to a single Diffusion server.

The Quick Start guide provides basic instructions on how to get connected to a Diffusion server.

See Also
PTDiffusionSessionStateChange
Since
5.6
Inheritance diagram for PTDiffusionSession:

Class Methods

(instancetype) + NS_UNAVAILABLE
 
(void) + openWithURL:configuration:completionHandler:
 
(void) + openWithURL:completionHandler:
 
(NSString *) + anonymousPrincipal
 
(NSString *) + allFixedProperties
 
(NSString *) + allUserProperties
 
(NSString *) + rolesPropertyKey
 
(NSString *) + sessionIdPropertyKey
 
(NSString *) + principalPropertyKey
 
(NSString *) + connectorPropertyKey
 
(NSString *) + transportPropertyKey
 
(NSString *) + clientTypePropertyKey
 
(NSString *) + countryPropertyKey
 
(NSString *) + languagePropertyKey
 
(NSString *) + serverNamePropertyKey
 
(NSString *) + clientIPPropertyKey
 
(NSString *) + latitudePropertyKey
 
(NSString *) + longitudePropertyKey
 
(NSString *) + startTimePropertyKey
 

Properties

PTDiffusionSessionConfigurationconfiguration
 
PTDiffusionSessionIdsessionId
 
NSString * principal
 
PTDiffusionSessionStatestate
 
id< PTDiffusionErrorListenererrorListener
 
PTDiffusionTopicsFeaturetopics
 
PTDiffusionTopicControlFeaturetopicControl
 
PTDiffusionTopicUpdateControlFeaturetopicUpdateControl
 
PTDiffusionMessagingFeaturemessaging
 
PTDiffusionMessagingControlFeaturemessagingControl
 
PTDiffusionSecurityFeaturesecurity
 
PTDiffusionPingsFeaturepings
 
PTDiffusionTimeSeriesFeaturetimeSeries
 
PTDiffusionTopicNotificationsFeaturetopicNotifications
 
PTDiffusionSubscriptionControlFeaturesubscriptionControl
 

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(void) - close
 

Method Documentation

+ (NSString *) allFixedProperties

This constant can be used instead of a property key in requests for session property values to indicate that all fixed session properties are required.

Since
6.0
+ (NSString *) allUserProperties

This constant can be used instead of a property key in requests for session property values to indicate that all user defined session properties are required.

Since
6.0
+ (NSString *) anonymousPrincipal

Value assigned to the principal property if this is an anonymous session.

Since
6.0
+ (NSString *) clientIPPropertyKey

Session property key for client IP address.

Since
6.2
+ (NSString *) clientTypePropertyKey

Session property key for client type.

Since
6.2
- (void) close

Close the session. Once closed a session cannot be restarted.

Since
5.6
+ (NSString *) connectorPropertyKey

Session property key for connector name.

Since
6.2
+ (NSString *) countryPropertyKey

Session property key for country code.

Since
6.2
+ (NSString *) languagePropertyKey

Session property key for language code.

Since
6.2
+ (NSString *) latitudePropertyKey

Session property key for client latitude.

Since
6.2
+ (NSString *) longitudePropertyKey

Session property key for client longitude.

Since
6.2
+ (void) openWithURL: (NSURL *)  url
completionHandler: (PTDiffusionSession *_Nullable)  session
(NSError *_Nullable error)  completionHandler 

Starts asynchronously connecting to a Diffusion server using the default session configuration.

Parameters
urlThe location of the server to connect to. Encapsulates host, port and protocol to use. Must be absolute.
completionHandlerThe completion handler to call on connection success or failure. The completion handler will be called from the main dispatch queue and will only be called once.
Note
Your completion handler must store a strong reference to the session instance in order for it to remain open.
The completion handler block is called after the session's state property has been set to connected but before those observing through the notification center are informed.
Since
5.6
+ (void) openWithURL: (NSURL *)  url
configuration: (PTDiffusionSessionConfiguration *)  configuration
completionHandler: (PTDiffusionSession *_Nullable)  session
(NSError *_Nullable error)  completionHandler 

Starts asynchronously connecting to a Diffusion server using the given session configuration.

Parameters
urlThe location of the server to connect to. Encapsulates host, port and protocol to use. Must be absolute.
configurationThe configuration options to connect with.
completionHandlerThe completion handler to call on connection success or failure. The completion handler will be called from the main dispatch queue and will only be called once.
Note
Your completion handler must store a strong reference to the session instance in order for it to remain open.
The completion handler block is called after the session's state property has been set to connected but before those observing through the notification center are informed.
Since
5.6
+ (NSString *) principalPropertyKey

Session property key for principal.

Since
6.2
+ (NSString *) rolesPropertyKey

Session property key for session roles.

Since
6.2
+ (NSString *) serverNamePropertyKey

Session property key for server name.

Since
6.2
+ (NSString *) sessionIdPropertyKey

Session property key for session identifier.

See Also
PTDiffusionSessionId
Since
6.2
+ (NSString *) startTimePropertyKey

Session property key for client start time.

Since
6.2
+ (NSString *) transportPropertyKey

Session property key for transport.

Since
6.2

Property Documentation

- (PTDiffusionSessionConfiguration*) configuration
readnonatomiccopy

The configuration used to open the session.

Since
5.6
- (id<PTDiffusionErrorListener>) errorListener
readwritenonatomicweak

The delegate to use to report unexpected, non-fatal errors to.

Since
6.0
- (PTDiffusionMessagingFeature*) messaging
readnonatomicassign

The Messaging feature provides messaging capabilities.

Since
5.6
- (PTDiffusionMessagingControlFeature*) messagingControl
readnonatomicassign

The Messaging Control feature provides the capability to use messaging functionality to communicate directly with other client sessions.

Since
6.0
- (PTDiffusionPingsFeature*) pings
readnonatomicassign

The Pings feature provides a client session with the ability to test the roundtrip time associated with sending a request to the server and receiving the associated response.

Since
5.7
- (NSString*) principal
readnonatomicassign

The name of the security principal associated with the session.

Returns
The principal name. If the session has no associated principal, it is known as an anonymous session, in which case the empty string anonymousPrincipal will be assigned to this property.
Since
6.0
- (PTDiffusionSecurityFeature*) security
readnonatomicassign

The Security feature provides a client session with the ability to change the associated principal.

Since
5.6
- (PTDiffusionSessionId*) sessionId
readnonatomicassign

The unique identifier for the session as assigned by the server it connects to.

This property is Key-Value Observable with changes being notified on the main dispatch queue.

- (PTDiffusionSessionState*) state
readnonatomicassign

The current state of the session.

This property is Key-Value Observable with changes being notified on the main dispatch queue. KVO notifications are sent before the invocation of any callback handler blocks.

Note
Session state can also be observed using the notification center. See PTDiffusionSessionStateChange for details.
Since
5.7
- (PTDiffusionSubscriptionControlFeature*) subscriptionControl
readnonatomicassign

The Subscription Control feature allows a client session to subscribe or unsubscribe other sessions to topics, as well as also providing a mechanism for handling requests to subscribe to routing topics.

Since
6.1
- (PTDiffusionTimeSeriesFeature*) timeSeries
readnonatomicassign

The Time Series feature provides a client session with the ability to update and query time series topics.

Since
6.0
- (PTDiffusionTopicControlFeature*) topicControl
readnonatomicassign

The Topic Control features provides the capability to manage topics.

Since
5.7
- (PTDiffusionTopicNotificationsFeature*) topicNotifications
readnonatomicassign

The Topic Notifications feature allows a client session to receive notifications about changes to selected topics.

Since
6.1
- (PTDiffusionTopicsFeature*) topics
readnonatomicassign

The Topics feature provides the capability to receive streamed topic updates and/or fetch the state of topics.

Since
5.6
- (PTDiffusionTopicUpdateControlFeature*) topicUpdateControl
readnonatomicassign

The Topic Update Control feature provides the capability to update topics.

Since
5.7