List Info

Thread: keyboard input & broadcast




keyboard input & broadcast
country flaguser name
United States
2007-09-10 00:29:26
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-talkrubyforge.org
http://rubyforge.org/mailman/listinfo/eventmachine-talk

Re: keyboard input & broadcast
user name
2007-09-11 12:46:35
On 9/10/07, Mark Zvilius < zviliusieee.org">zviliusieee.org&gt; wrote:
 
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.&quot; 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



sync to the current head revision. There is a file named KEYBOARD that will answer your questions about the keyboard handling.

For UDP broadcasts, just sent the packet to a target address of 255.255.255.255 to get a broadcast on your local lan.

Re: keyboard input & broadcast
country flaguser name
United States
2007-09-11 18:33:54

“sync to the current head revision.&#8221;

 

I’m not familiar with this process, could you help me get off the ground? What I tried is copied below. It looks like setup.rb is trying to find <windows.h>, so I̵7;ll work on getting the right include paths so that it is found, but if I̵7;m going about this the wrong way please let me know.

 

Thanks!

Mark Z.

 

 

Made a copy of my /ruby tree à /rubz, then…;

C:>svn co svn://rubyforget.org/var/svn/eventmachine/version_0 x

C:>cd x

C:x>setup all --prefix=c:/rubz

---> lib

---> lib/em

<--- lib/em

---> lib/evma

<--- lib/evma

---> lib/protocols

<--- lib/protocols

<--- lib

---> ext

c:/ruby/bin/ruby.exe C:/x/ext/extconf.rb

checking for windows.h... no

*** C:/x/ext/extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of

necessary libraries and/or headers.&nbsp; Check the mkmf.log file for more

details.&nbsp; You may need configuration options.

 

Provided configuration options:

 &nbsp; &nbsp; &nbsp;  --with-opt-dir

 &nbsp; &nbsp; &nbsp;  --without-opt-dir

 &nbsp; &nbsp; &nbsp;  --with-opt-include

 &nbsp; &nbsp; &nbsp;  --without-opt-include=$/include

 &nbsp; &nbsp; &nbsp;  --with-opt-lib

 &nbsp; &nbsp; &nbsp;  --without-opt-lib=${opt-dir}/lib

 &nbsp; &nbsp; &nbsp;  --with-make-prog

 &nbsp; &nbsp; &nbsp;  --srcdir=C:/x/ext

 &nbsp; &nbsp; &nbsp;  --curdir

 &nbsp; &nbsp; &nbsp;  --ruby=c:/ruby/bin/ruby

 

 


From: eventmachine-talk-bouncesrubyforge.org [mailto:eventmachine-talk-bouncesrubyforge.org] On Behalf Of Francis Cianfrocca
Sent: Tuesday, September 11, 2007 10:47 AM
To: eventmachine-talkrubyforge.org
Subject: Re: [Eventmachine-talk] keyboard input & broadcast

 


sync to the current head revision. There is a file named KEYBOARD that will answer your questions about the keyboard handling.

For UDP broadcasts, just sent the packet to a target address of 255.255.255.255 to get a broadcast on your local lan.

 

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )