From: Gary Wright Date: 2011-05-16T09:10:54+09:00 Subject: Re: Ruby socket does not get reply On May 14, 2011, at 1:16 PM, 7stud -- wrote: > Just be aware that ruby is going to convert a "\n" to "\r\n" on windows, > so on windows you will actually be wrting: > > "\r\n" > = "\r" + "\n" > = "\r" + "\r\n" > = "\r\r\n" > > That may or may not make a difference to a particular program. I don't have a Windows system to test on but I'm pretty sure that sockets are always automatically opened in binary mode. On my Mac OS system: irb> socket = TCPSocket.new("www.google.com", 80) => # irb > socket.binmode? => true The HTTP protocol requires "\r\n" line endings though so they have to be written explicitly on the binary socket as described in the earlier messages. Gary Wright