verse.client: Add stream:close()

Sat, 28 Nov 2009 22:29:29 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 28 Nov 2009 22:29:29 +0000
changeset 12
73f466054ead
parent 11
ce349990bd21
child 13
c3d83b98fb4f

verse.client: Add stream:close()

client.lua file | annotate | diff | comparison | revisions
--- 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
+

mercurial