From: Albert Chou Date: 2003-09-24T05:56:31+09:00 Subject: Re: exerb and a threaded server This is a multi-part message in MIME format. ------_=_NextPart_001_01C38215.1D783B6E Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dan, You can also use the following trick to allow Windows to see the Ctrl-C signal. Put the line Thread.new { loop { sleep 0.01 } } # workaround to allow Ruby on Windows to handle Ctrl-C to quit before the main loop of your program. Al -----Original Message----- From: Berger, Daniel [mailto:djberge@qwest.com] Sent: Tuesday, September 23, 2003 1:43 PM To: ruby-talk ML Subject: Re: exerb and a threaded server > -----Original Message----- > From: Nathaniel Talbott [mailto:nathaniel@NOSPAMtalbott.ws]=20 > Sent: Tuesday, September 23, 2003 2:29 PM > To: ruby-talk@ruby-lang.org > Subject: Re: exerb and a threaded server >=20 > Berger, Daniel [mailto:djberge@qwest.com] wrote: >=20 > > However, when I tried to build and rbc file, it just hangs: > > C:\test>ruby -r exerb/mkrbc exetest.rb -> hangs indefinitely=20 > > > > Any ideas? >=20 > Well, mkrbc basically just sits back and watches your program=20 > run from start to finish, recording all the required=20 > libraries along the way. In this, case your program sits=20 > there waiting for connections, thus mkrbc sits there waiting=20 > for your program. You need to do something to quit the=20 > program, and then mkrbc should write out your recipe file. >=20 > HTH, >=20 >=20 > Nathaniel >=20 > <:((>< Ah, ok. Because of the curious interaction SIGINT and threads on windows, the first thing I tried was killing this using the Task Manager. However, when I did that the .rbc file was NOT generated. I got it to work by running "ruby -r exerb/mkrbc exetest.rb" and hitting Ctrl-C in one terminal (which doesn't kill it), and then attempting to make a connection in a second terminal with a throw-away client script (which then does kill it). At that point, the .rbc file was generated, I created a .exe and ran it successfully. Anyway, hope that helps future Googler's. And thanks Nathaniel. Regards, Dan ------_=_NextPart_001_01C38215.1D783B6E Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: exerb and a threaded server

Dan,

You can also use the following trick to allow Windows = to see the Ctrl-C signal.  Put the line

Thread.new { loop { sleep 0.01 } } # workaround to = allow Ruby on Windows to handle Ctrl-C to quit

before the main loop of your program.


Al


-----Original Message-----
From: Berger, Daniel [mailto:djberge@qwest.com]
Sent: Tuesday, September 23, 2003 1:43 PM
To: ruby-talk ML
Subject: Re: exerb and a threaded server

> -----Original Message-----
> From: Nathaniel Talbott [mailto:nathaniel@NOSPAMtalbott= .ws]
> Sent: Tuesday, September 23, 2003 2:29 PM
> To: ruby-talk@ruby-lang.org
> Subject: Re: exerb and a threaded server
>
> Berger, Daniel [mailto:djberge@qwest.com] = wrote:
>
> > However, when I tried to build and rbc = file, it just hangs:
> > C:\test>ruby -r exerb/mkrbc exetest.rb = -> hangs indefinitely
> >
> > Any ideas?
>
> Well, mkrbc basically just sits back and watches = your program
> run from start to finish, recording all the = required
> libraries along the way. In this, case your = program sits
> there waiting for connections, thus mkrbc sits = there waiting
> for your program. You need to do something to = quit the
> program, and then mkrbc should write out your = recipe file.
>
> HTH,
>
>
> Nathaniel
>
> <:((><

Ah, ok.  Because of the curious interaction = SIGINT and threads on
windows, the first thing I tried was killing this = using the Task
Manager.  However, when I did that the .rbc file = was NOT generated.

I got it to work by running "ruby -r exerb/mkrbc = exetest.rb" and hitting
Ctrl-C in one terminal (which doesn't kill it), and = then attempting to
make a connection in a second terminal with a = throw-away client script
(which then does kill it).  At that point, the = .rbc file was generated,
I created a .exe and ran it successfully.

Anyway, hope that helps future Googler's.  And = thanks Nathaniel.

Regards,

Dan

------_=_NextPart_001_01C38215.1D783B6E--