ObjXMPP  Check-in [9e5a047eec]

Overview
Comment:Add -[socket] to XMPPConnection.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9e5a047eec3237a2117ce27b18167aab36c65161792cc22a39352c9e803e825c
User & Date: js on 2011-04-01 02:26:54
Other Links: manifest | tags
Context
2011-04-02
14:07
Don't leak the old socket when using STARTTLS. check-in: c59cefc261 user: js tags: trunk
2011-04-01
02:26
Add -[socket] to XMPPConnection. check-in: 9e5a047eec user: js tags: trunk
02:23
Add -[parseBuffer:withSize:] to XMPPConnection. check-in: 31846fcc3b user: js tags: trunk
Changes

Modified src/XMPPConnection.h from [30a48b2ec0] to [63ae59d595].

84
85
86
87
88
89
90

91
92
93
94
95
96
97

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *username, *password, *server, *resource;
@property (copy, readonly) XMPPJID *JID;
@property (assign) uint16_t port;
@property (retain) id <XMPPConnectionDelegate> delegate;
@property (readonly, retain) XMPPRoster *roster;

#endif

/**
 * \return A new autoreleased XMPPConnection
 */
+ connection;








>







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *username, *password, *server, *resource;
@property (copy, readonly) XMPPJID *JID;
@property (assign) uint16_t port;
@property (retain) id <XMPPConnectionDelegate> delegate;
@property (readonly, retain) XMPPRoster *roster;
@property (readonly, retain, getter=socket) OFTCPSocket *sock;
#endif

/**
 * \return A new autoreleased XMPPConnection
 */
+ connection;

113
114
115
116
117
118
119





120
121
122
123
124
125
126
 * \param buf The buffer to parse
 * \param size The size of the buffer. If size is 0, it is assumed that the
 *	       connection was closed.
 */
- (void)parseBuffer: (const char*)buf
	   withSize: (size_t)size;






/**
 * Sends an OFXMLElement, usually an XMPPStanza.
 *
 * \param elem The element to send
 */
- (void)sendStanza: (OFXMLElement*)elem;








>
>
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 * \param buf The buffer to parse
 * \param size The size of the buffer. If size is 0, it is assumed that the
 *	       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
 */
- (void)sendStanza: (OFXMLElement*)elem;

Modified src/XMPPConnection.m from [82b4f2ceb5] to [08a8e3a88e].

235
236
237
238
239
240
241





242
243
244
245
246
247
248
	if (size < 1 && [delegate respondsToSelector:
	    @selector(connectionWasClosed:)])
		[delegate connectionWasClosed: self];

	[parser parseBuffer: buf
		   withSize: size];
}






- (void)sendStanza: (OFXMLElement*)elem
{
	of_log(@"Out: %@", elem);
	[sock writeString: [elem XMLString]];
}








>
>
>
>
>







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
	if (size < 1 && [delegate respondsToSelector:
	    @selector(connectionWasClosed:)])
		[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]];
}