Option

public enum Option

Initialization options for a Connection object.

  • The queue to use for the transmission methods. If no queue is given a queue will be created if te transmitterQueueQoS is set. If no transmitterQueueQoS is set all transmission will take place immediately on the thread of the transmit caller.

    Declaration

    Swift

    case transmitterQueue(DispatchQueue)
  • The quality of service for a transmitterQueue to be created if no transmitterQueue is set. Without either transmitterQueueQoS or transmitterQueue all transmissions will take place immediately on the thread of the transmit caller.

    Declaration

    Swift

    case transmitterQueueQoS(DispatchQoS)
  • The timeout for transmissions.

    Default is 10 seconds.

    Declaration

    Swift

    case transmitterTimeout(TimeInterval)
  • The queue on which the receiver loop will run. If no receiverQueue is set, a new queue will be created with the quality of service as given in receiverQueueQoS.

    Declaration

    Swift

    case receiverQueue(DispatchQueue)
  • The quality of service for the receiverQueue to be created if no receiverQueue is set.

    Default is .default

    Declaration

    Swift

    case receiverQueueQoS(DispatchQoS)
  • The duration of the receiverLoop.

    Default is 5 seconds.

    Declaration

    Swift

    case receiverLoopDuration(TimeInterval)
  • The size for the receiver buffer.

    Default is 20 * 1024

    Declaration

    Swift

    case receiverBufferSize(Int)
  • The connection will be considered inactive if no transmission has taken place for at least as long as this time interval. When a connection is considered inactive, it will be closed. To avoid closing a connection after it becomes inactive specify nil (default).

    Default is nil (none). Very small or 0 will lead to an immediate close of the connection after initial activity. This can lead to seemingly unpredictable behaviour. Servers typically use a default of 300 milli seconds or more.

    When used, this value should strike a balance between keeping a connection open in anticipation of more activity (and thus avoiding the overhead of negotiation & accepting & preparing a new connection) and closing a connection because it is consuming system resources (including the connection itself if a connection pool is used) that are needed elsewhere.

    Declaration

    Swift

    case inactivityDetectionThreshold(TimeInterval?)
  • A closure that will be invoked when errors occur that do not result in either a TransmitterProtocol method call or a ReceiverProtocol method call.

    Declaration

    Swift

    case errorHandler(ErrorHandler)