SocketIOClientOption

public enum SocketIOClientOption : ClientOption

The options for a client.

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

    Declaration

    Swift

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

    Declaration

    Swift

    case connectParams([String: Any])
  • An array of cookies that will be sent during the initial connection.

    Declaration

    Swift

    case cookies([HTTPCookie])
  • Any extra HTTP headers that should be sent during the initial connection.

    Declaration

    Swift

    case extraHeaders([String: String])
  • 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)
  • If passed true, the only transport that will be used will be HTTP long-polling.

    Declaration

    Swift

    case forcePolling(Bool)
  • If passed true, the only transport that will be used will be WebSockets.

    Declaration

    Swift

    case forceWebsockets(Bool)
  • The queue that all interaction with the client should occur on. This is the queue that event handlers are called on.

    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)
  • nsp

    The namespace that this client should connect to. Can be changed during use using the joinNamespace and leaveNamespace methods on SocketIOClient.

    Declaration

    Swift

    case nsp(String)
  • 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)
  • 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)
  • The number of times to try and reconnect before giving up. Pass -1 to never give up.

    Declaration

    Swift

    case reconnectAttempts(Int)
  • The number of seconds to wait before reconnect attempts.

    Declaration

    Swift

    case reconnectWait(Int)
  • Set true if your server is using secure transports.

    Declaration

    Swift

    case secure(Bool)
  • Allows you to set which certs are valid. Useful for SSL pinning.

    Declaration

    Swift

    case security(SSLSecurity)
  • If you’re using a self-signed set. Only use for development.

    Declaration

    Swift

    case selfSigned(Bool)
  • Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs.

    Declaration

    Swift

    case sessionDelegate(URLSessionDelegate)
  • If passed true, the WebSocket transport will try and use voip logic to keep network connections open in the background. This option is experimental as socket.io shouldn’t be used for background communication.

    Declaration

    Swift

    case voipEnabled(Bool)
  • The description of this option.

    Declaration

    Swift

    public var description: String
  • 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.