TipServer

public class TipServer: ServerProtocol

This class implements a TCP/IP server.

The server has several options with which it can be configured. At a minimum the connectionObjectFactory must be initialized.

  • Options with which the TipServer can be initialized.

    See more

    Declaration

    Swift

    public enum Option
  • Signature of the alive handler. The aliveHandler is invoked for each accept statement that times out.

    Declaration

    Swift

    public typealias AliveHandler = () -> ()
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Undocumented

    Declaration

    Swift

    public class TipServer: ServerProtocol
  • Declaration

    Swift

    public var isRunning: Bool
  • This initializer allows the creation of placeholder objects. Before using the object it should be initialized with setOptions.

    Declaration

    Swift

    public init()
  • Create a new server with the given options. Only initializes internal data. Does not allocate system resources.

    Declaration

    Swift

    public init(_ options: Option ...)

    Parameters

    options

    A set of options. See Option member descriptions.

  • Set one or more options. Note that it is not possible to change any options while the server is running.

    Declaration

    Swift

    public func setOptions(_ options: [Option]) -> Result<Bool>

    Parameters

    options

    An array of options. See Option member descriptions.

    Return Value

    Either .success(true) or .error(message: String)

  • Set one or more options. Note that it is not possible to change any options while the server is running.

    Declaration

    Swift

    public func setOptions(_ options: Option ...) -> Result<Bool>

    Parameters

    options

    A set of options. See Option member descriptions.

    Return Value

    Either .success(true) or .error(message: String)

  • Starts the server. If the server is running, this operation will have no effect.

    Note

    A connectionObjectFactory must have been set.

    Declaration

    Swift

    public func start() -> Result<Bool>

    Return Value

    Either .success(true) or .error(message: String)

  • Instructs the server to stop accepting new connection requests. Notice that it only stops the server and not the receiver loops that may be running.

    Declaration

    Swift

    public func stop()