ASFaspSessionDelegate

@protocol ASFaspSessionDelegate

Delegate for events triggered during a session’s lifetime

  • Invoked at the very beginning of a session’s lifetime

    Declaration

    Objective-C

    - (void)sessionWillStart:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionWillStart(session: ASAbstractFaspSession)
  • Invoked when a connection has been established with the remote host and the transfer has started

    Declaration

    Objective-C

    - (void)sessionWillStartData:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionWillStartData(session: ASAbstractFaspSession)
  • Invoked periodically throughout a session’s lifetime to indicate progress.

    The latest session statistics are available via the stats attribute. This delegate will be invoked at regular intervals regardless of whether or not the session’s stats progress attribute changes, however, for very short transfers it may not be invoked at all

    Declaration

    Objective-C

    - (void)sessionProgressDidChange:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionProgressDidChange(session: ASAbstractFaspSession)
  • Invoked when transfer of a file in the session has begun.

    Note that this callback may be invoked multiple times (for different files) before the corresponding -[ASFaspSessionDelegate fileDidStop:] callback will be invoked (that is files in a session can be transferred in parallel)

    Declaration

    Objective-C

    - (void)sessionWillStartFile:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionWillStartFile(session: ASAbstractFaspSession)
  • Invoked when transfer of a file in the session has ended.

    Declaration

    Objective-C

    - (void)sessionWillStopFile:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionWillStopFile(session: ASAbstractFaspSession)
  • Invoked when -[ASAbstractFaspSession stop] is called. This callback signifies that the given session will be stopped, however the session may continue running for a short amount of time. The session has fully stopped when -[ASFaspSessionDelegate sessionDidEnd:] is triggered

    Declaration

    Objective-C

    - (void)sessionWillStop:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionWillStop(session: ASAbstractFaspSession)
  • Invoked when a session has finished transferring but before the connection with the remote host has been closed.

    This method precedes -[ASFaspSessionDelegate sessionDidSucceed:], -[ASFaspSessionDelegate sessionDidFail:] and -[ASFaspSessionDelegate sessionDidStop:].

    Declaration

    Objective-C

    - (void)sessionDidEndData:(nonnull ASAbstractFaspSession *)session;

    Swift

    optional func sessionDidEndData(session: ASAbstractFaspSession)
  • Invoked at the very end of a session’s lifetime. The parameter finalState will be euqal to ASFaspSessionStateSucceeded if the session succeeds, ASFaspSessionStopped if the session was stopped using -[ASAbstractFaspSession stop], and ASFaspSessionStateFailed if the session failed (in which case the error is available via -[ASAbstractSession lastError]).

    Declaration

    Objective-C

    - (void)sessionDidEnd:(nonnull ASAbstractFaspSession *)session
                    state:(id)finalState;

    Swift

    optional func sessionDidEnd(session: ASAbstractFaspSession, state finalState: AnyObject!)