summaryrefslogtreecommitdiff
path: root/tests/modules/socket/tcp/echo_server.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modules/socket/tcp/echo_server.lua')
-rw-r--r--tests/modules/socket/tcp/echo_server.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/modules/socket/tcp/echo_server.lua b/tests/modules/socket/tcp/echo_server.lua
index a047aa15f..7c200989b 100644
--- a/tests/modules/socket/tcp/echo_server.lua
+++ b/tests/modules/socket/tcp/echo_server.lua
@@ -13,6 +13,14 @@ function main()
sock_client = sock:accept()
if sock_client then
print("%s: accepted", sock_client)
+ local recv, data = sock_client:recv(8192)
+ if recv == 0 then
+ print("wait ..")
+ ok = sock_client:wait(socket.EV_RECV, -1)
+ print("wait %d", ok)
+ recv, data = sock_client:recv(8192)
+ end
+ print("%s: recv %d, %s", sock_client, recv, data)
sock_client:close()
end
end