From: Joel VanderWerf Date: 2010-06-17T10:34:13+09:00 Subject: Re: Socket Problems Doug Jolley wrote: > I want to use a Ruby script to connect to a vendor API. I have 2 > problems: 1) It takes almost a minute to establish a connection; and, > 2) after the connection is finally established, no data is returned in > response to any requests. IO#read will read until EOF unless you tell it how many bytes to read: > puts("Connect:\n"+socket.read()+"\n\n") as you did in php: > print("Connect:\n".fread($fp,1000)."\n\n");