Forum: Ruby Socket#read raising Errno::EINTR

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bryan R. (Guest)
on 2009-04-07 10:48
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
Loga G. (Guest)
on 2009-04-07 11:23
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.
This topic is locked and can not be replied to.