1 -- Tests Copas with a simple Echo server
3 -- Run the test file and the connect to the server by telnet on the used port
4 -- to stop the test just send the command "quit"
8 local function echoHandler(skt
)
10 local data
,ret
= luaevent
.receive(skt
, 10)
11 if data
== "quit" or ret
== 'closed' then
15 luaevent
.send(skt
, data
)
19 local server
= assert(socket
.bind("localhost", 20000))
22 luaevent
.addserver(server
, echoHandler
)