From 4121a434b79e07e02c3bf869ea99077ba4a30b58 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Fri, 1 Apr 2011 04:26:54 +0200 Subject: [PATCH] Add -[socket] to XMPPConnection. --- src/XMPPConnection.h | 6 ++++++ src/XMPPConnection.m | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index ac03b17..04394d0 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -88,6 +88,7 @@ @property (assign) uint16_t port; @property (retain) id delegate; @property (readonly, retain) XMPPRoster *roster; +@property (readonly, retain, getter=socket) OFTCPSocket *sock; #endif /** @@ -117,6 +118,11 @@ - (void)parseBuffer: (const char*)buf withSize: (size_t)size; +/** + * \return The socket used by the XMPPConnection + */ +- (OFTCPSocket*)socket; + /** * Sends an OFXMLElement, usually an XMPPStanza. * diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index f260a4c..d2d8048 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -240,6 +240,11 @@ withSize: size]; } +- (OFTCPSocket*)socket +{ + return [[sock retain] autorelease]; +} + - (void)sendStanza: (OFXMLElement*)elem { of_log(@"Out: %@", elem);