Ruby networking, cuts off at new line?

I have been trying to figure this out without any luck, maybe someone
here will know what is going on. I notice that it gets the first line
and then cuts off at the new line, but I have no idea why it is doing
this.

···

#####################################################################
........
puts "a\nb".class
=> string

hostname = 'localhost'
port = 5000
s = TCPSocket.open(hostname, port)
s.puts "a\nb"
s.close

###########################################################
..........

server = TCPServer.open(5000)
loop do
Thread.start(server.accept) do |client|
message = client.gets

puts message
=> a

###########################################################

--
Posted via http://www.ruby-forum.com/.

Ah stupid me, gets and puts of course cut off on new line. I changed to
read and write and now it is working. I will leave this instead of
delete it, maybe some other noob will stumble on it someday.

···

--
Posted via http://www.ruby-forum.com/.