aboutsummaryrefslogtreecommitdiffstats
path: root/luaevent/test/testClient.lua
diff options
context:
space:
mode:
Diffstat (limited to 'luaevent/test/testClient.lua')
-rw-r--r--luaevent/test/testClient.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/luaevent/test/testClient.lua b/luaevent/test/testClient.lua
new file mode 100644
index 0000000..b6dfa44
--- /dev/null
+++ b/luaevent/test/testClient.lua
@@ -0,0 +1,15 @@
+require"luaevent"
+require"socket"
+
+local function func()
+ print("ACTIVATED")
+ local sock = socket.tcp()
+ --sock:
+ sock = luaevent.wrap(sock)
+ print(assert(sock:connect("localhost", 20000)))
+ for i = 1, 100000 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end
+end
+
+luaevent.addthread(func)
+
+luaevent.loop() \ No newline at end of file