From: Joel VanderWerf Date: 2008-06-11T07:16:18+09:00 Subject: Re: Non blocking UDP Leslie Viljoen wrote: > Hello! > > I need to make a UDP server that waits for clients to log on and then drives > communication from the server side. This means that if a client doesn't ack > subsequent comms from the server, the server needs to resend those > comms a few times before giving up. > > I have gotten as far as a successful UDP server, but it blocks the thread > forever, and having a server constantly breaking out of > socket.recvfrom using Timeout > does not seem to work at all (port never seems open). I need a UDP wait > with a timeout. > > I have looked at several UDP examples, and tried the sparse docs here: > http://ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M004528 > > - but no luck yet. I tried recvfrom_nonblock as a guess but it seems to > block anyway. > > Any tips? > > Les IO#select ? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407