I received the following reply from Francis C. to a posting
in the Ruby
forum.
Francis Cianfrocca wrote:
> On 9/2/07, Mark Zvilius wrote:
>>
>> I want to use Ruby for a UDP server application
under Windows XP. I
>> intend to use two threads: one for a simple UI,
and a separate thread
>> for the UDP server (with blocking calls).
>>
>> As a proof of concept I wrote the following test
code, whose intent is
>> to wait for an incoming message, with the user
able to press CTRL-C to
>> terminate the "server."
>
>
>
> Look at Ruby/EventMachine, which can solve your
problem without threads.
> Sync to the current head revision to get a recent
addition which allows
> you
> to respond to keyboard input.
I've been playing with EventMachine, and have a couple of
questions.
1. Francis mentioned "a recent addition which allows
you to respond to
keyboard input." I haven't found any reference to that
capability. I am
using eventmachine 0.8.1 .. is that the current version? If
so, please
point me to the feature that Francis suggested. (I'm
developing in the
Windows environment.)
2. One thing I need to do is implement a discovery protocol,
involving a
UDP broadcast. I don't see a way to set SO_BROADCAST on the
underlying
socket. Is there any way to do that?
Thanks,
Mark Zvilius
_______________________________________________
Eventmachine-talk mailing list
Eventmachine-talk rubyforge.org
http://rubyforge.org/mailman/listinfo/eventmachine-talk
a>
|