Back to Socket Io Client Swift

SocketIOClientOption

docs/Enums/SocketIOClientOption.html

16.1.15.5 KB
Original Source

SocketIOClientOption

public enum SocketIOClientOption : ClientOption

The options for a client.

`

                compress
                `

If given, the WebSocket transport will attempt to use compression.

Declaration

Swift

case compress

`

                connectParams(_:)
                `

A dictionary of GET parameters that will be included in the connect url.

Declaration

Swift

case connectParams([String : Any])

`

                cookies(_:)
                `

An array of cookies that will be sent during the initial connection.

Declaration

Swift

case cookies([HTTPCookie])

`

                extraHeaders(_:)
                `

Any extra HTTP headers that should be sent during the initial connection.

Declaration

Swift

case extraHeaders([String : String])

`

                forceNew(_:)
                `

If passed true, will cause the client to always create a new engine. Useful for debugging, or when you want to be sure no state from previous engines is being carried over.

Declaration

Swift

case forceNew(Bool)

`

                forcePolling(_:)
                `

If passed true, the only transport that will be used will be HTTP long-polling.

Declaration

Swift

case forcePolling(Bool)

`

                forceWebsockets(_:)
                `

If passed true, the only transport that will be used will be WebSockets.

Declaration

Swift

case forceWebsockets(Bool)

`

                enableSOCKSProxy(_:)
                `

If passed true, the WebSocket stream will be configured with the enableSOCKSProxy true.

Declaration

Swift

case enableSOCKSProxy(Bool)

`

                handleQueue(_:)
                `

The queue that all interaction with the client should occur on. This is the queue that event handlers are called on.

This should be a serial queue! Concurrent queues are not supported and might cause crashes and races.

Declaration

Swift

case handleQueue(DispatchQueue)

`

                log(_:)
                `

If passed true, the client will log debug information. This should be turned off in production code.

Declaration

Swift

case log(Bool)

`

                logger(_:)
                `

Used to pass in a custom logger.

Declaration

Swift

case logger(SocketLogger)

`

                path(_:)
                `

A custom path to socket.io. Only use this if the socket.io server is configured to look for this path.

Declaration

Swift

case path(String)

`

                reconnects(_:)
                `

If passed false, the client will not reconnect when it loses connection. Useful if you want full control over when reconnects happen.

Declaration

Swift

case reconnects(Bool)

`

                reconnectAttempts(_:)
                `

The number of times to try and reconnect before giving up. Pass -1 to never give up.

Declaration

Swift

case reconnectAttempts(Int)

`

                reconnectWait(_:)
                `

The minimum number of seconds to wait before reconnect attempts.

Declaration

Swift

case reconnectWait(Int)

`

                reconnectWaitMax(_:)
                `

The maximum number of seconds to wait before reconnect attempts.

Declaration

Swift

case reconnectWaitMax(Int)

`

                randomizationFactor(_:)
                `

The randomization factor for calculating reconnect jitter.

Declaration

Swift

case randomizationFactor(Double)

`

                secure(_:)
                `

Set true if your server is using secure transports.

Declaration

Swift

case secure(Bool)

`

                security(_:)
                `

Allows you to set which certs are valid. Useful for SSL pinning.

Declaration

Swift

case security(CertificatePinning)

`

                selfSigned(_:)
                `

If you’re using a self-signed set. Only use for development.

Declaration

Swift

case selfSigned(Bool)

`

                sessionDelegate(_:)
                `

Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs.

Declaration

Swift

case sessionDelegate(URLSessionDelegate)

`

                version(_:)
                `

The version of socket.io being used. This should match the server version. Default is 3.

Declaration

Swift

case version(SocketIOVersion)

Properties

`

                description
                `

The description of this option.

Declaration

Swift

public var description: String { get }

Operators

`

                ==(_:_:)
                `

Compares whether two options are the same.

Declaration

Swift

public static func == (lhs: SocketIOClientOption, rhs: SocketIOClientOption) -> Bool

Parameters

| lhs |

Left operand to compare.

| | rhs |

Right operand to compare.

|

Return Value

true if the two are the same option.