From: Alex McHale Date: 2001-03-03T02:12:19+09:00 Subject: [ruby-talk:11908] TCPSocket Hi there, I'm working on the networking core for a client/server, and am just working on familiarizing myself with the Ruby classes for this. I have a very basic client that would hopefully connect to a server and just display what it receives. But it just doesn't work without me sending information. Like this: require 'socket' s = TCPSocket.open( 'localhost', 80 ) while TRUE print s.gets end I know it isn't quite proper with the endless loop, but it is only there for testing purposes. But it just doesn't work. This, however, works, assuming I hit enter each time I want a line, instead of just displaying everything it receives: require 'socket' s = TCPSocket.open( 'localhost', 80 ) while gets s.write $_ print s.gets end s.close Can anyone explain to me what I'm doing wrong here? I have tried several different types of servers in addition to the web server - all to the same result. If I have it so I hit enter each time and write it to the socket before I do the s.gets, it works. But I just can't get it to do a simple "go to the server and dump what you see" sort of thing. Alex McHale