receive timeout on socket

Discussion in 'Ruby' started by Michael P. Soulier, Sep 24, 2006.

  1. --DMS1jUnP4bTQsFAd
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    Hello,

    How do I set a receive timeout on a UDPSocket? I'd like to timeout after 5
    seconds. I tried this

    sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, SockTimeout)

    but I got an error.

    =2E/bin/../lib/net/tftp+.rb:508:in `setsockopt': Invalid argument
    (Errno::EINVAL)
    from ./bin/../lib/net/tftp+.rb:508:in `download'
    from ./bin/tftp_client.rb:81:in `main'
    from ./bin/tftp_client.rb:98

    Mike
    --=20
    Michael P. Soulier <>
    "Any intelligent fool can make things bigger and more complex... It
    takes a touch of genius - and a lot of courage to move in the opposite
    direction." --Albert Einstein

    --DMS1jUnP4bTQsFAd
    Content-Type: application/pgp-signature
    Content-Disposition: inline

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQFFFfS+KGqCc1vIvggRAjVrAJ9gouc6j3hFAsG3dRfn1T4FlvgmKQCdHsYq
    rcTcDeNXk3KCvyd/dqlBOwk=
    =nByH
    -----END PGP SIGNATURE-----

    --DMS1jUnP4bTQsFAd--
     
    Michael P. Soulier, Sep 24, 2006
    #1
    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. p.
    Replies:
    4
    Views:
    598
    Giampaolo Rodola'
    Jan 10, 2009
  2. Laszlo Nagy
    Replies:
    1
    Views:
    4,858
    Mark Wooding
    Jan 27, 2009
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    974
    Jean-Paul Calderone
    Jan 27, 2009
  4. Laszlo Nagy
    Replies:
    0
    Views:
    553
    Laszlo Nagy
    Feb 1, 2009
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,293
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page