Skip to content

Commit

Permalink
Only keep reading from tcp client while socket exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Ritzl committed Jul 28, 2017
1 parent 0618f14 commit 444cd30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion defnet/tcp_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function M.create(server_ip, server_port, on_data, on_disconnect)
end

if receivet[client_socket] then
while true do
while client_socket do
local data, err = client_socket:receive(client.pattern or "*l")
if data then
local response = on_data(data)
Expand Down

0 comments on commit 444cd30

Please sign in to comment.