receive timeout on socket

M

Michael P. Soulier

--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 <[email protected]>
"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--
 

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

Similar Threads

undefined method `recvfrom_nonblock' 9
alarm? 4
ANN: Tftpplus 0.4 0
FileUtils.cp 4
using common layout in Rails 3
global error handling in rails 0
variable access through self 2
Weird DNS problem with net/http 1

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top