XMPPFileTransfer.h
2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// Created by Jonathon Staff on 10/21/14.
// Copyright (c) 2014 nplexity, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "XMPP.h"
#import "XMPPModule.h"
#import "TURNSocket.h"
@import CocoaAsyncSocket;
@class XMPPIDTracker;
typedef NS_OPTIONS(uint8_t, XMPPFileTransferStreamMethod) {
XMPPFileTransferStreamMethodBytestreams = 1 << 0, // If set, SOCKS5 connections allowed
XMPPFileTransferStreamMethodIBB = 1 << 1, // If set, IBB connections allowed
// XMPPFileTransferStreamMethodJingle = 1 << 2 // If set, Jingle connections allowed
// Note that Jingle is not yet implemented
};
/**
* This class defines common elements of the file transfer process that apply to
* both outgoing and incoming transfers.
*
* You'll find more detailed documentation in each of the implementation files.
*
* By default, the stream-method priority is as follows:
*
* 1. SOCKS5 Direct Connection (http://xmpp.org/extensions/xep-0065.html#direct)
* 2. SOCKS5 Mediated (http://xmpp.org/extensions/xep-0065.html#mediated)
* 3. IBB (http://xmpp.org/extensions/xep-0047.html)
*/
@interface XMPPFileTransfer : XMPPModule <GCDAsyncSocketDelegate> {
XMPPFileTransferStreamMethod _streamMethods;
XMPPIDTracker *_idTracker;
GCDAsyncSocket *_asyncSocket;
NSMutableArray *_streamhosts;
}
/**
* The streamID ("sid") for the file transfer.
*/
@property (nonatomic, copy) NSString *sid;
/**
* Use this to disable file transfers via direct connection.
*
* If set to YES, SOCKS5 transfers will only take place if there is a proxy that
* works. If set to NO, SOCKS5 transfers will attempt a direct connection first
* and fall back to a proxy if the direct connection doesn't work.
*
* The default value is NO.
*/
@property (nonatomic, assign) BOOL disableDirectTransfers;
/**
* Use this to disable file transfers via SOCKS5.
*
* If set to YES, SOCKS5 transfers will not be used. This means that the
* recipient must support IBB transfers or the transfer will fail. If set to NO,
* a SOCKS5 connection will be attempted first, since this should be the
* preferred method of transfer.
*
* The default value is NO.
*/
@property (nonatomic, assign) BOOL disableSOCKS5;
/**
* Use this to disable file transfers via IBB.
*
* If set to YES, IBB transfers will not be used. This means that the
* recipient must support SOCKS5 transfers or the transfer will fail. If set to
* NO, a SOCKS5 connection will be attempted first, since this should be the
* preferred method of transfer.
*
* The default value is NO.
*/
@property (nonatomic, assign) BOOL disableIBB;
@end