ReceiverProtocol

public protocol ReceiverProtocol

A collection of methods used by a receiver loop to inform a data receiver of the events occuring on the interface.

  • Called when an error occured while receiving.

    The receiver has stopped, but the connection has not been closed or released.

    Declaration

    Swift

    func receiverError(_ message: String)

    Parameters

    message

    A textual description of the error that occured.

  • Some data was received and is ready for processing.

    Data can arrive in multiple blocks. End detection is the responsibility of the receiver.

    Declaration

    Swift

    func receiverData(_ buffer: UnsafeBufferPointer<UInt8>) -> Bool

    Parameters

    buffer

    A buffer where the data that was received is located.

    Return Value

    Return true to continue receiving, false to stop receiving. The connection will not be closed or released.

  • The connection was unexpectedly closed. It is not sure that the connection has been properly closed or deallocated.

    Probably by the other side or because of a parralel operation on a different thread.

    Declaration

    Swift

    func receiverClosed()
  • Since the last data transfer (or start of operation) a timeinterval as specified in ReceiverLoopDuration has elapsed without any activity.

    Declaration

    Swift

    func receiverLoop() -> Bool

    Return Value

    Return true to continue receiving, false to stop receiving. The connection will not be closed or released.