Option

public enum Option

Options with which the TipServer can be initialized.

  • The port on which the server will be listening.

    Default = 80

    Declaration

    Swift

    case port(String)
  • The maximum number of connection requests that will be queued.

    Default = 20

    Declaration

    Swift

    case maxPendingConnectionRequests(Int)
  • This specifies the duration of the accept loop when no connection requests arrive.

    Default = 5 seconds

    Declaration

    Swift

    case acceptLoopDuration(TimeInterval)
  • The server socket operations (Accept loop and errorProcessor) run synchronously on this queue.

    Default = serial with .default qos.

    Declaration

    Swift

    case acceptQueue(DispatchQueue)
  • This closure will be invoked after a connection is accepted. It will run on the acceptQueue and block further accepts until it finishes.

    Must be provided before server is started.

    Declaration

    Swift

    case connectionObjectFactory(ConnectionObjectFactory)
  • This closure will be called when the accept loop wraps around without any activity. It will run on the accept queue and should return asap.

    Default = nil

    Declaration

    Swift

    case aliveHandler(AliveHandler?)
  • This closure will be called to inform the callee of possible error’s during the accept loop. The accept loop will try to continue after reporting an error. It will run on the accept queue and should return asap.

    Default = nil

    Declaration

    Swift

    case errorHandler(ErrorHandler?)
  • This closure is started right after a connection has been accepted, but before the connection object factory is called. If it returns ‘true’ processing resumes as normal and the connection object factor is called. If it returns false, the connection will be terminated.

    Default = nil

    Declaration

    Swift

    case addressHandler(AddressHandler?)