ObjXMPP  Check-in [cd6ac2904d]

Overview
Comment:Make reconnecting possible.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cd6ac2904dab316d41527b78aec749b862b0009f248e48d6d2ff84a977840891
User & Date: florob@babelmonkeys.de on 2012-12-13 21:20:33
Original User & Date: florob@babelmonkeys.de on 2012-12-13 21:20:34
Other Links: manifest | tags
Context
2012-12-13
21:20
XMPPRoster: Notify delegates before updating roster check-in: bc252638ef user: florob@babelmonkeys.de tags: trunk
21:20
Make reconnecting possible. check-in: cd6ac2904d user: florob@babelmonkeys.de tags: trunk
2012-12-09
20:53
Fix typo intenral -> internal check-in: ea1c2bdca9 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPConnection.m from [edc286114d] to [b0f0c109e0].

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
}

- init
{
	self = [super init];

	@try {
		sock = [[OFTCPSocket alloc] init];
		port = 5222;
		encrypted = NO;
		streamOpen = NO;
		delegates = [[XMPPMulticastDelegate alloc] init];
		callbacks = [[OFMutableDictionary alloc] init];
	} @catch (id e) {
		[self release];







<







65
66
67
68
69
70
71

72
73
74
75
76
77
78
}

- init
{
	self = [super init];

	@try {

		port = 5222;
		encrypted = NO;
		streamOpen = NO;
		delegates = [[XMPPMulticastDelegate alloc] init];
		callbacks = [[OFMutableDictionary alloc] init];
	} @catch (id e) {
		[self release];
253
254
255
256
257
258
259






260
261
262
263
264
265
266
- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	XMPPSRVEntry *candidate = nil;
	XMPPSRVLookup *SRVLookup = nil;
	OFEnumerator *enumerator;







	if (server)
		[sock connectToHost: [self XMPP_IDNAToASCII: server]
			       port: port];
	else {
		@try {
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: domainToASCII];







>
>
>
>
>
>







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	XMPPSRVEntry *candidate = nil;
	XMPPSRVLookup *SRVLookup = nil;
	OFEnumerator *enumerator;

	if (sock != nil)
		@throw [OFAlreadyConnectedException
		    exceptionWithClass: [self class]];

	sock = [[OFTCPSocket alloc] init];

	if (server)
		[sock connectToHost: [self XMPP_IDNAToASCII: server]
			       port: port];
	else {
		@try {
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: domainToASCII];
631
632
633
634
635
636
637
638
639
640
641













642
643
644
645
646
647
648
			   @"version='1.0'>", domain, langString];

	streamOpen = YES;
}

- (void)close
{
	if (streamOpen) {
		[sock writeString: @"</stream:stream>"];
		streamOpen = NO;
	}













}

- (void)XMPP_handleStanza: (OFXMLElement*)element
{
	if ([[element name] isEqual: @"iq"]) {
		[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: element]];
		return;







|

|
|
>
>
>
>
>
>
>
>
>
>
>
>
>







636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
			   @"version='1.0'>", domain, langString];

	streamOpen = YES;
}

- (void)close
{
	if (streamOpen)
		[sock writeString: @"</stream:stream>"];


	[oldParser release];
	oldParser = nil;
	[oldElementBuilder release];
	oldElementBuilder = nil;
	[authModule release];
	authModule = nil;
	[sock release];
	sock = nil;
	[JID release];
	JID = nil;
	streamOpen = needsSession = encrypted = NO;
	supportsRosterVersioning = supportsStreamManagement = NO;
	lastID = 0;
}

- (void)XMPP_handleStanza: (OFXMLElement*)element
{
	if ([[element name] isEqual: @"iq"]) {
		[self XMPP_handleIQ: [XMPPIQ stanzaWithElement: element]];
		return;