UDP socket delay

Discussion in 'Ruby' started by Roeland Moors, Apr 5, 2005.

  1. 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
    Roeland Moors, Apr 5, 2005
    #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. Replies:
    2
    Views:
    2,985
    David Van de Voorde
    Jan 21, 2005
  2. Laszlo Nagy
    Replies:
    1
    Views:
    4,808
    Mark Wooding
    Jan 27, 2009
  3. chris guenther
    Replies:
    0
    Views:
    106
    chris guenther
    Apr 10, 2005
  4. David Holroyd
    Replies:
    3
    Views:
    515
    David Holroyd
    May 25, 2005
  5. Kishore_R

    Socket() failed for UDP socket

    Kishore_R, Oct 11, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    226
    Anno Siegel
    Oct 11, 2005
Loading...

Share This Page