InterfaceAccess

public protocol InterfaceAccess

The i/o functions that glue a Connection object to an interface.

  • An id that can be used for logging purposes and will differentiate between interfaces on a temporary basis.

    It should be guaranteed that no two interfaces with the same logId are active at the same time.

    Declaration

    Swift

    var logId: Int32
  • Closes the connection.

    Note

    Data transfers will be aborted if running and may result in error messages on the receiver/transmitter protocols.

    Declaration

    Swift

    mutating func close()
  • Transfers the data in the buffer to the peer.

    Declaration

    Swift

    func transfer(

    Parameters

    buffer

    The buffer with data to be transferred.

    timeout

    The timeout for the transfer.

    callback

    The receiver for the TransmitterProtocol method calls (if present).

    progress

    The closure that is invoked after partial transfers (if any).

    Return Value

    See the TransferResult definition.

  • Starts a receiver loop that will call the operations as defined in the ReceiverProtocol on the receiver.

    Note

    There will be no return from this function until a ReceiverProtocol method singals so, or until an error occurs.

    Declaration

    Swift

    func receiverLoop(

    Parameters

    bufferSize

    The size of the buffer to create in bytes.

    duration

    The duration for the loop.

    receiver

    The receiver for the ReceiverProtocol method calls (if present).