Socket#read raising Errno::EINTR


#1

Hello all,

I’ve got some socket code that is causing me some headaches. I create a
socket, write to it, then wait for the server to respond back. See
below:

@conn = TCPSocket.new(@host,@port)
@conn.write(some_string)
@conn.read(7) <-- I always expect the server to return 7 bytes of data
back

When I get to @conn.read(7), it throws an Errno::EINTR - ‘Interrupted
system call’ exception. Anyone know what’s causing this?!


Thanks!
Bryan


#2

Bryan R. wrote:

Hello all,

I’ve got some socket code that is causing me some headaches. I create a
socket, write to it, then wait for the server to respond back. See
below:

@conn = TCPSocket.new(@host,@port)
@conn.write(some_string)
@conn.read(7) <-- I always expect the server to return 7 bytes of data
back

When I get to @conn.read(7), it throws an Errno::EINTR - ‘Interrupted
system call’ exception. Anyone know what’s causing this?!


Thanks!
Bryan

It works for me. Can u send your actual server and client program , so
that I
could help you.