summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/multiple_client_test.lua')
-rw-r--r--Sluift/multiple_client_test.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/Sluift/multiple_client_test.lua b/Sluift/multiple_client_test.lua
new file mode 100644
index 0000000..d2b2cd7
--- /dev/null
+++ b/Sluift/multiple_client_test.lua
@@ -0,0 +1,26 @@
+require "sluift"
+
+-- sluift.debug = true
+num_clients = 10
+
+print("Connecting clients")
+clients = {}
+for i = 1, num_clients do
+ jid = os.getenv("SWIFT_CLIENTTEST_JID") .. "/Client" .. i
+ client = sluift.new_client(jid, os.getenv("SWIFT_CLIENTTEST_PASS"))
+ client:async_connect()
+ table.insert(clients, client)
+end
+
+print("Waiting for clients to be connected")
+for i, client in ipairs(clients) do
+ client:wait_connected()
+ client:send_presence("Hello")
+end
+
+print("Disconnecting clients")
+for i, client in ipairs(clients) do
+ client:disconnect()
+end
+
+print("Done")