File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -331,18 +331,23 @@ typedef enum XMPPStreamErrorCode XMPPStreamErrorCode;
331
331
332
332
/* *
333
333
* Disconnects from the remote host by closing the underlying TCP socket connection.
334
+ * The terminating </stream:stream> element is not sent to the server.
334
335
*
335
- * The disconnect method is synchronous.
336
+ * This method is synchronous.
336
337
* Meaning that the disconnect will happen immediately, even if there are pending elements yet to be sent.
337
- * The xmppStreamDidDisconnect:withError: method will be invoked before the disconnect method returns.
338
338
*
339
- * The disconnectAfterSending method is asynchronous.
340
- * The disconnect will happen after all pending elements have been sent.
341
- * Attempting to send elements after this method is called will not result in the elements getting sent.
342
- * The disconnectAfterSending method will return immediately,
343
- * and the xmppStreamDidDisconnect:withError: delegate method will be invoked at a later time.
339
+ * The xmppStreamDidDisconnect:withError: delegate method will immediately be dispatched onto the delegate queue.
344
340
**/
345
341
- (void )disconnect ;
342
+
343
+ /* *
344
+ * Disconnects from the remote host by sending the terminating </stream:stream> element,
345
+ * and then closing the underlying TCP socket connection.
346
+ *
347
+ * This method is asynchronous.
348
+ * The disconnect will happen after all pending elements have been sent.
349
+ * Attempting to send elements after this method has been called will not work (the elements won't get sent).
350
+ **/
346
351
- (void )disconnectAfterSending ;
347
352
348
353
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -1137,6 +1137,13 @@ - (void)disconnectAfterSending
1137
1137
}
1138
1138
else
1139
1139
{
1140
+ NSString *termStr = @" </stream:stream>" ;
1141
+ NSData *termData = [termStr dataUsingEncoding: NSUTF8StringEncoding];
1142
+
1143
+ XMPPLogSend (@" SEND: %@ " , termStr);
1144
+ numberOfBytesSent += [termData length ];
1145
+
1146
+ [asyncSocket writeData: termData withTimeout: TIMEOUT_XMPP_WRITE tag: TAG_XMPP_WRITE_STREAM];
1140
1147
[asyncSocket disconnectAfterWriting ];
1141
1148
1142
1149
// Everthing will be handled in socketDidDisconnect:withError:
You can’t perform that action at this time.
0 commit comments