I have a loop whilethat sequentially listens for incoming connections and outputs them to the console. I would like to be able to issue commands through the console without affecting the output. I tried:
Thread.new do
while true
input = gets.chomp
puts "So I herd u sed, \"#{input}\"."
end
end
However, this seems to pause my entire script until input is received; and even then some of the threads that I initiated before this one seem to not be running. I tried looking at the TCPSocket method to select()no avail.
source
share