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

Introduction

A session configuration defines behavior and policies to use when connecting to Diffusion.

See Also
PTDiffusionSession
Since
5.6
Inheritance diagram for PTDiffusionSessionConfiguration:
PTDiffusionMutableSessionConfiguration

Class Methods

(NSUInteger) + defaultRecoveryBufferSize
 
(NSTimeInterval) + defaultConnectionTimeout
 
(NSUInteger) + maximumMessageSizeMinimum
 
(NSUInteger) + defaultMaximumMessageSize
 
(NSUInteger) + defaultMaximumQueueSize
 

Properties

NSString * principal
 
PTDiffusionCredentialscredentials
 
NSNumber * reconnectionTimeout
 
id
< PTDiffusionSessionReconnectionStrategy
reconnectionStrategy
 
NSUInteger recoveryBufferSize
 
NSUInteger maximumMessageSize
 
NSUInteger maximumQueueSize
 
NSTimeInterval connectionTimeout
 
NSDictionary * sslOptions
 
NSDictionary< NSString
*, NSString * > * 
properties
 
PTDiffusionHTTPProxyConfigurationhttpProxyConfiguration
 

Instance Methods

(instancetype) - initWithPrincipal:credentials:
 
(BOOL) - isEqualToSessionConfiguration:
 

Method Documentation

+ (NSTimeInterval) defaultConnectionTimeout

The default connection timeout (2 seconds).

Returns
Time interval representing the default connection timeout.
Since
5.7
+ (NSUInteger) defaultMaximumMessageSize

The default maximum message size in bytes.

The maximum message size limits the size of received messages. This default value is NSUIntegerMax, so the message size is effectively unlimited.

Returns
Number representing the default maximum message size in bytes.
See Also
maximumMessageSize
Since
6.0
+ (NSUInteger) defaultMaximumQueueSize

The default maximum outbound queue size in messages.

Returns
Number representing the default maximum outbound queue size in messages.
See Also
maximumQueueSize
Since
6.0
+ (NSUInteger) defaultRecoveryBufferSize

The default recovery buffer size in messages.

Returns
Number representing the default recovery buffer size in messages.
See Also
recoveryBufferSize
Since
6.0
- (instancetype) initWithPrincipal: (nullable NSString *)  principal
credentials: (nullable PTDiffusionCredentials *)  credentials 

Returns a session configuration object initialized with the given principal and credentials.

Parameters
principalThe security principal to use when opening the session. A value of nil dictates that no principal name will be associated with the session, indicating anonymous authentication.
credentialsThe security credentials to use when opening the session. A value of nil dictates that no credentials will be used when authenticating the session.
Returns
The session configuration instance initialized with the given principal and credentials.
Since
5.6
- (BOOL) isEqualToSessionConfiguration: (nullable PTDiffusionSessionConfiguration *)  sessionConfiguration

Compares the receiver to the given session configuration.

Parameters
sessionConfigurationThe session configuration object with which to compare the receiver.
Returns
YES if the receiver and the given session configuration will have the same effect.
Since
5.6
+ (NSUInteger) maximumMessageSizeMinimum

The lowest value that the maximum message size can be set to in bytes.

Returns
Number representing the lowest value in bytes that the maximum message size can be set to.
See Also
maximumMessageSize
Since
6.0

Property Documentation

- (NSTimeInterval) connectionTimeout
readnonatomicassign

The connection timeout.

This constrains the time taken to establish an initial connection to the server. The server is responsible for limiting the overall time taken to complete a connection once it has received the request.

Since
5.7
- (PTDiffusionCredentials*) credentials
readnonatomiccopy

The security credentials to use when opening the session.

A value of nil dictates that no credentials will be used when authenticating the session.

Since
5.6
- (PTDiffusionHTTPProxyConfiguration*) httpProxyConfiguration
readnonatomiccopy

Configuration of the HTTP Proxy that should be used to make connections to the server.

This allows connection to a server using HTTP CONNECT tunneling through the specified proxy.

A value of nil dictates that a proxy is not used. This is the default.

Since
6.0
- (NSUInteger) maximumMessageSize
readnonatomicassign

The maximum message size in bytes.

This constrains the size of messages that may be received from the server and thus the size of any content that can be received. The limit protects against unexpectedly large messages.

See Also
+ defaultMaximumMessageSize
+ maximumMessageSizeMinimum
Since
6.0
- (NSUInteger) maximumQueueSize
readnonatomicassign

The maximum size of the outbound message queue for the connection.

The outbound message queue should be large enough to accommodate all the messages sent to the server. This would include topic updates, messaging and service requests such as registering a handler.

It may be necessary to increase this value for applications that send messages in bursts, or continue to send messages when a session is disconnected and reconnecting. Larger values allow more messages to be queued, and increase the memory footprint of the session.

If the outbound message queue fills, sending a message will cause the session to close with an error.

See Also
+ defaultMaximumQueueSize
Since
6.0
- (NSString*) principal
readnonatomiccopy

The security principal to use when opening the session.

A value of nil dictates that no principal name will be associated with the session, indicating anonymous authentication.

Since
5.6
- (NSDictionary<NSString *, NSString *>*) properties
readnonatomiccopy

User-defined session properties.

These properties will be provided to the server when a session is created using this session configuration. They will be validated during authentication and may be discarded or changed.

A value of nil or an empty dictionary indicates that no user-defined session properties will be provided to the server on connection.

Since
6.3
- (id<PTDiffusionSessionReconnectionStrategy>) reconnectionStrategy
readnonatomicassign

The reconnection strategy that will be used on connection failure.

A value of nil when a valid reconnectionTimeout has been set dictates that the default reconnection strategy will be employed.

Since
5.6
- (NSNumber*) reconnectionTimeout
readnonatomicassign

The reconnection timeout in seconds that will be used on connection failure.

The reconnection timeout boxed by this number is accessed as a double representing an NSTimeInterval.

A value of nil or a negative boxed value both dictate that reconnection will be disabled.

Since
5.6
- (NSUInteger) recoveryBufferSize
readnonatomicassign

The recovery buffer size in messages; can be zero.

If the server is configured to support reconnection, a session established with a non-zero reconnection time retains a buffer of sent messages. If the session disconnects and reconnects, this buffer is used to re-send messages that the server has not received.

Higher values increase the chance of successful reconnection, but increase the per-session memory footprint.

See Also
+ defaultRecoveryBufferSize
Since
6.0
- (NSDictionary*) sslOptions
readnonatomiccopy

Security settings to be applied to the underlying transport streams for SSL/TLS encrypted connections.

A value of nil or an empty dictionary indicates that default settings, as defined by the host operating system, will be applied.

Supported keys are documented by Apple under 'CFStream Property SSL Settings Constants' in their Core Foundation CFStream Reference.

For example, a rudimentary approach to allowing otherwise disallowed self-signed certificates could be to disable validation of the certificate chain entirely:

configuration.sslOptions =
    [NSDictionary dictionaryWithObject:kCFBooleanFalse
                                forKey:kCFStreamSSLValidatesCertificateChain];
Since
5.7.1