SKYLINKConnectionFileTransferDelegate Protocol Reference

Conforms to NSObject
Declared in SKYLINKConnection.h

Overview

Delegate methods are called on the main thread.

– connection:didReceiveRequest:peerId:

Called upon receiving a file transfer request from a peer.

- (void)connection:(SKYLINKConnection *)connection didReceiveRequest:(NSString *)filename peerId:(NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didReceivePermission:filename:peerId:

Called upon receiving a file transfer permission from a peer.

- (void)connection:(SKYLINKConnection *)connection didReceivePermission:(BOOL)isPermitted filename:(NSString *)filename peerId:(NSString *)peerId

Parameters

connection

The underlying connection object.

isPermitted

Flag to specify whether the request was accepted.

filename

The name of the file in request.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didDropTransfer:reason:isExplicit:peerId:

Called when the file being transferred is halted.

- (void)connection:(SKYLINKConnection *)connection didDropTransfer:(NSString *)filename reason:(NSString *)message isExplicit:(BOOL)isExplicit peerId:(NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

message

The message specifying reason for the file transfer drop.

isExplicit

Flag to specify whether the transfer was halted explicity by the sender.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h

– connection:didUpdateProgress:isOutgoing:filename:peerId:

Called upon every file transfer progress update.

- (void)connection:(SKYLINKConnection *)connection didUpdateProgress:(CGFloat)percentage isOutgoing:(BOOL)isOutgoing filename:(NSString *)filename peerId:(NSString *)peerId

Parameters

connection

The underlying connection object.

percentage

The perccentage representing the progress of the transfer (CGFloat from 0 to 1).

isOutgoing

Boolean to specify if the transfer is a file beign sent (value would be YES) or received (value would be NO).

filename

The name of the file in transmission.

peerId

The unique id of the peer thie file is sent to or received from.

Discussion

Alternatively, if many of your objects need to get these informations, it can register to the notification with identifier: @“SKYLINKFileProgress”.

Declared In

SKYLINKConnection.h

– connection:didCompleteTransfer:fileData:peerId:

Called upon file transfer completion.

- (void)connection:(SKYLINKConnection *)connection didCompleteTransfer:(NSString *)filename fileData:(NSData *)fileData peerId:(NSString *)peerId

Parameters

connection

The underlying connection object.

filename

The name of the file in request.

fileData

NSData object holding the data transferred.

peerId

The unique id of the peer.

Declared In

SKYLINKConnection.h