Fixec and enhanced the bind_socket method in AssetHandler. Multi-thread, close socket when no more data is received, print_debug raw request

This commit is contained in:
antisnatchor
2012-07-23 10:55:41 +01:00
parent 1defa2dbc2
commit 6342fdad77

View File

@@ -69,9 +69,14 @@ module Handlers
server = TCPServer.new(host,port)
loop do
Thread.start(server.accept) do |client|
# client.puts ""
# we don't close the client socket
# client.close
data = ""
recv_length = 64
while (tmp = client.recv(recv_length))
data += tmp
break if tmp.length < recv_length
end
client.close
print_debug "Bind Socket on Thread [#{name}] received:\n#{data}"
end
end
}