Add interactive chat to sample client

This commit is contained in:
ChillerDragon 2024-06-18 12:07:24 +08:00
parent 7e45bbe038
commit ba7bfc6c07

View file

@ -81,4 +81,9 @@ Signal.trap('INT') do
end
# connect and detach thread
client.connect(args[:ip], args[:port], detach: false)
client.connect(args[:ip], args[:port], detach: true)
loop do
msg = gets.chomp
client.send_chat(msg)
end