Benedikt Mueller wrote:
> All 3 tips didn't help 
>
> I made it in a standalone script for now:
>
> require 'socket'
> begin
> rescue EPIPE
> sfm=TCPSocket.open('localhost', 54311)
> # while line = sfm.read(100)
> sfm.puts "info %a : %t - %R\r\n"
> # sfm.close_write
> bla = sfm.read(100)
> puts bla
> sfm.close
> end
That makes no sense. You've put all the useful code under a rescue
clause - which means it won't run until an exception is raised. That
program should simply terminate.
I suggest you use puts bla.inspect instead of puts bla, in case you're
just getting an empty string back.
In any case, on my machine (Ubuntu), EPIPE does not exist. The constant
is Errno::EPIPE. Are you running on Windows perhaps? While you're at it,
it would be helpful if you said the exact version of Ruby you're using
too.
If this is ruby-1.9 and Windows, then I don't use either...
--
Posted via
http://www.ruby-forum.com/.