Add -[parseBuffer:withSize:] to XMPPConnection.
This commit is contained in:
parent
2554b3a778
commit
673daaf20b
2 changed files with 26 additions and 0 deletions
|
@ -90,6 +90,9 @@
|
||||||
@property (readonly, retain) XMPPRoster *roster;
|
@property (readonly, retain) XMPPRoster *roster;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \return A new autoreleased XMPPConnection
|
||||||
|
*/
|
||||||
+ connection;
|
+ connection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,6 +105,18 @@
|
||||||
*/
|
*/
|
||||||
- (void)handleConnection;
|
- (void)handleConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the specified buffer.
|
||||||
|
*
|
||||||
|
* This is useful for handling multiple connections at once.
|
||||||
|
*
|
||||||
|
* \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.
|
* Sends an OFXMLElement, usually an XMPPStanza.
|
||||||
*
|
*
|
||||||
|
|
|
@ -229,6 +229,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)parseBuffer: (const char*)buf
|
||||||
|
withSize: (size_t)size
|
||||||
|
{
|
||||||
|
if (size < 1 && [delegate respondsToSelector:
|
||||||
|
@selector(connectionWasClosed:)])
|
||||||
|
[delegate connectionWasClosed: self];
|
||||||
|
|
||||||
|
[parser parseBuffer: buf
|
||||||
|
withSize: size];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)sendStanza: (OFXMLElement*)elem
|
- (void)sendStanza: (OFXMLElement*)elem
|
||||||
{
|
{
|
||||||
of_log(@"Out: %@", elem);
|
of_log(@"Out: %@", elem);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue