Changeset

12:73f466054ead

verse.client: Add stream:close()
author Matthew Wild <mwild1@gmail.com>
date Sat, 28 Nov 2009 22:29:29 +0000
parents 11:ce349990bd21
children 13:c3d83b98fb4f
files client.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client.lua	Sat Nov 28 22:29:09 2009 +0000
+++ b/client.lua	Sat Nov 28 22:29:29 2009 +0000
@@ -65,3 +65,10 @@
 	self:send(st.stanza("stream:stream", { to = self.host, ["xmlns:stream"]='http://etherx.jabber.org/streams', xmlns = "jabber:client" }):top_tag());
 end
 
+function stream:close(reason)
+	if not self.notopen then
+		self:send("</stream:stream>");
+	end
+	self.conn:close();
+end
+