tags:

views:

774

answers:

1

i have a Broken pipe (Errno::EPIPE) error popping up and i don't understand what it is or how to fix it. the full error is:

example.rb:19:in `write': Broken pipe (Errno::EPIPE)
    from example.rb:19:in `print'
    from example.rb:19

line 19 of my code is:

vari.print("x=" + my_val + "&y=1&z=Add+Num\r\n")
+1  A: 

It means that whatever connection print is outputting to is no longer connected. Presumably the program began as input to some other program:

 % ruby_program | another_program

What's happened is that another_program has exited sometime before the print in question.

wallyk
actually, this code is all for an http request. does that just mean the server isn't connected at that point? this seems to be happening randomly.
hatorade
I don't know much about ruby, but EPIPE maybe could be a network disconnection. On Linux I would expect the error would be ENETRESET, ECONNABORTED, ECONNRESET, ENOTCONN, or ESHUTDOWN for that condition.
wallyk