Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > UDP socket delay

Reply
Thread Tools

UDP socket delay

 
 
Roeland Moors
Guest
Posts: n/a
 
      04-05-2005
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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket() failed for UDP socket Kishore_R Perl Misc 2 10-11-2005 08:57 AM
UDP select()/recvfrom() delay under Windows? David Holroyd Ruby 3 05-25-2005 10:02 AM
weird delay of UDP server (seems to be thread-scheduling issue) chris guenther Ruby 0 04-10-2005 06:21 PM
J2ME UDP Datagram 3 Second Delay gordonmcdowell@gmail.com Java 2 01-21-2005 01:53 PM
udp (0) -> udp (0) traffic ? Tom Cisco 2 03-04-2004 06:06 PM



Advertisments