[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

UDP socket delay

Roeland Moors

4/5/2005 6:27:00 PM

I'm trying to recieve syslog messages under windows.
This code works, but it takes about 5 seconds to recieve the message.
---8<---
require 'socket'

thread = Thread.new do
socket = UDPSocket.new
socket.bind('', 514)
while true
if IO.select([socket], nil, nil, 0)
p socket.recvfrom(1024)
break
end
end
end

thread.join
---8<---
I also tested other non-ruby programs and they seem to recieve this faster.
Can I speed things up, or is this normal?

Roeland