27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
+
|
#include <stringprep.h>
#include <idna.h>
#import <ObjOpenSSL/SSLSocket.h>
#import "XMPPConnection.h"
#import "XMPPSRVEnumerator.h"
#import "XMPPSCRAMAuth.h"
#import "XMPPPLAINAuth.h"
#import "XMPPStanza.h"
#import "XMPPJID.h"
#import "XMPPIQ.h"
#import "XMPPMessage.h"
#import "XMPPPresence.h"
|
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
|
{
return [[password copy] autorelease];
}
- (void)connect
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
XMPPSRVEnumerator *SRVEnumerator =
[XMPPSRVEnumerator enumeratorWithDomain: server];
XMPPSRVEntry *candidate;
while ((candidate = [SRVEnumerator nextObject])) {
@try {
[sock connectToHost: [candidate target]
onPort: [candidate port]];
break;
} @catch (id e) {
if (([e class] == [OFAddressTranslationFailedException
class]) || ([e class] ==
[OFConnectionFailedException class]))
continue;
else
@throw e;
}
}
if (!candidate)
[sock connectToHost: server
onPort: port];
[sock connectToHost: server
onPort: port];
[self XMPP_startStream];
[pool release];
}
- (void)handleConnection
{
|