PortMonitor

public class PortMonitor : BaseNotificationMonitor

A PortMonitor instance monitors a port for changes to its validity.

  • Encapsulates changes to the validity of the port.

    See more

    Declaration

    Swift

    public enum Event
  • Initializes a new PortMonitor.

    Declaration

    Swift

    public init(port: Port,
                queue: OperationQueue = .main,
                handler: @escaping (Event) -> Void)

    Parameters

    port

    The port to monitor.

    queue

    The operation queue on which the handler executes. By default, the main operation queue is used.

    handler

    The handler to call when the validity of the port changes.

  • The port being monitored.

    Declaration

    Swift

    public let port: Port
  • Declaration

    Swift

    override public func addNotificationObservers()