diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-25 22:53:06 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-26 00:14:08 (GMT) |
commit | c2886c9ff6152130e2adb006f84268f972e629cc (patch) | |
tree | 57093d110044ae97075d26fb238e6ae77e96414c /Sluift/multiple_client_test.lua | |
parent | 7e4b8e330c99a1db81bdf12b7aab41f5890625e5 (diff) | |
download | swift-contrib-c2886c9ff6152130e2adb006f84268f972e629cc.zip swift-contrib-c2886c9ff6152130e2adb006f84268f972e629cc.tar.bz2 |
Some more sluift tweaks.
Diffstat (limited to 'Sluift/multiple_client_test.lua')
-rw-r--r-- | Sluift/multiple_client_test.lua | 26 |
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") |