Socket#read raising Errno::EINTR

  • Thread starter Bryan Richardson
  • Start date
B

Bryan Richardson

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?!
 
L

Loga Ganesan

Bryan said:
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?!

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,097
Latest member
RayE496148

Latest Threads

Top