diff options
author | Thomas Harning Jr <harningt@gmail.com> | 2007-08-31 09:34:09 -0400 |
---|---|---|
committer | Thomas Harning Jr <harningt@gmail.com> | 2007-08-31 09:34:09 -0400 |
commit | 4c2a04eded5c66c6696d4b53aee339f0f3ab8155 (patch) | |
tree | e5ad5a8ea9377f7b1c18732f094c11bcb610ae81 /luaevent/test | |
parent | ae3262e075eadefbae445e64576f6a10f0d3e236 (diff) | |
download | luaevent-prosody-4c2a04eded5c66c6696d4b53aee339f0f3ab8155.tar.gz luaevent-prosody-4c2a04eded5c66c6696d4b53aee339f0f3ab8155.zip |
Reformed project layout from 'luaevent/*' -> '*'
Diffstat (limited to 'luaevent/test')
-rw-r--r-- | luaevent/test/test.lua | 34 | ||||
-rw-r--r-- | luaevent/test/testClient.lua | 19 |
2 files changed, 0 insertions, 53 deletions
diff --git a/luaevent/test/test.lua b/luaevent/test/test.lua deleted file mode 100644 index 412857e..0000000 --- a/luaevent/test/test.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Tests Copas with a simple Echo server --- --- Run the test file and the connect to the server by telnet on the used port --- to stop the test just send the command "quit" - -require"luaevent" -require"socket" -local oldPrint = print -print = function(...) - oldPrint("SRV", ...) -end - -local function echoHandler(skt) - while true do - local data,ret = luaevent.receive(skt, 10) - --print("GOT: ", data, ret) - if data == "quit" or ret == 'closed' then - break - end - luaevent.send(skt, data) - collectgarbage() - end - skt:close() - --print("DONE") -end -local server = assert(socket.bind("localhost", 20000)) -server:settimeout(0) -local coro = coroutine.create -coroutine.create = function(...) - local ret = coro(...) - return ret -end -luaevent.addserver(server, echoHandler) -luaevent.loop() diff --git a/luaevent/test/testClient.lua b/luaevent/test/testClient.lua deleted file mode 100644 index fbbcf87..0000000 --- a/luaevent/test/testClient.lua +++ /dev/null @@ -1,19 +0,0 @@ -require"luaevent" -require"socket" -local oldPrint = print -print = function(...) - oldPrint("CLT", ...) -end - -local function func() - print("ACTIVATED") - local sock = socket.tcp() - --sock: - sock = luaevent.wrap(sock) - print(assert(sock:connect("localhost", 20000))) - for i = 1, 100 do assert(sock:send("Greet me ")) assert(sock:receive(10)) collectgarbage() end -end - -luaevent.addthread(func) - -luaevent.loop()
\ No newline at end of file |