Make reconnecting possible.
This commit is contained in:
parent
1445c7654c
commit
6331f5695f
1 changed files with 22 additions and 4 deletions
|
@ -69,7 +69,6 @@
|
|||
self = [super init];
|
||||
|
||||
@try {
|
||||
sock = [[OFTCPSocket alloc] init];
|
||||
port = 5222;
|
||||
encrypted = NO;
|
||||
streamOpen = NO;
|
||||
|
@ -257,6 +256,12 @@
|
|||
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];
|
||||
|
@ -635,10 +640,23 @@
|
|||
|
||||
- (void)close
|
||||
{
|
||||
if (streamOpen) {
|
||||
if (streamOpen)
|
||||
[sock writeString: @"</stream:stream>"];
|
||||
streamOpen = NO;
|
||||
}
|
||||
|
||||
|
||||
[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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue