Socket#read raising Errno::EINTR

Discussion in 'Ruby' started by Bryan Richardson, Apr 7, 2009.

  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
    --
    Posted via http://www.ruby-forum.com/.
     
    Bryan Richardson, Apr 7, 2009
    #1
    1. Advertising

  2. Bryan Richardson

    Loga Ganesan Guest

    Bryan Richardson 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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Loga Ganesan, Apr 7, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. viza

    &errno, sizeof errno

    viza, Sep 12, 2008, in forum: C Programming
    Replies:
    20
    Views:
    1,056
    Tim Rentsch
    Sep 14, 2008
  2. Glenn Linderman

    errno 22 instead of errno 2

    Glenn Linderman, Jan 28, 2009, in forum: Python
    Replies:
    0
    Views:
    381
    Glenn Linderman
    Jan 28, 2009
  3. Ben Gribaudo
    Replies:
    6
    Views:
    224
    Ben Gribaudo
    Apr 19, 2005
  4. oleg korenevich
    Replies:
    4
    Views:
    460
    Mel Wilson
    Feb 2, 2012
  5. Konrad Eisele

    IO::Socket using $! == EINTR

    Konrad Eisele, Jul 4, 2005, in forum: Perl Misc
    Replies:
    0
    Views:
    141
    Konrad Eisele
    Jul 4, 2005
Loading...

Share This Page