Index: src/XMPPConnection.h ================================================================== --- src/XMPPConnection.h +++ src/XMPPConnection.h @@ -86,10 +86,11 @@ @property (copy) OFString *username, *password, *server, *resource; @property (copy, readonly) XMPPJID *JID; @property (assign) uint16_t port; @property (retain) id delegate; @property (readonly, retain) XMPPRoster *roster; +@property (readonly, retain, getter=socket) OFTCPSocket *sock; #endif /** * \return A new autoreleased XMPPConnection */ @@ -115,10 +116,15 @@ * connection was closed. */ - (void)parseBuffer: (const char*)buf withSize: (size_t)size; +/** + * \return The socket used by the XMPPConnection + */ +- (OFTCPSocket*)socket; + /** * Sends an OFXMLElement, usually an XMPPStanza. * * \param elem The element to send */ Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -237,10 +237,15 @@ [delegate connectionWasClosed: self]; [parser parseBuffer: buf withSize: size]; } + +- (OFTCPSocket*)socket +{ + return [[sock retain] autorelease]; +} - (void)sendStanza: (OFXMLElement*)elem { of_log(@"Out: %@", elem); [sock writeString: [elem XMLString]];