From: "Berger, Daniel" Date: 2003-09-25T00:00:43+09:00 Subject: Re: exerb and a threaded server This is a multi-part message in MIME format. ------_=_NextPart_001_01C382AC.98CFB200 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Worked like a charm! Thanks! =20 Dan -----Original Message----- From: Albert Chou [mailto:achou@tealeaf.com]=20 Sent: Tuesday, September 23, 2003 2:57 PM To: ruby-talk@ruby-lang.org Subject: Re: exerb and a threaded server Dan,=20 You can also use the following trick to allow Windows to see the Ctrl-C signal. Put the line=20 Thread.new { loop { sleep 0.01 } } # workaround to allow Ruby on Windows to handle Ctrl-C to quit=20 before the main loop of your program.=20 Al=20 -----Original Message-----=20 From: Berger, Daniel [mailto:djberge@qwest.com]=20 Sent: Tuesday, September 23, 2003 1:43 PM=20 To: ruby-talk ML=20 Subject: Re: exerb and a threaded server=20 > -----Original Message-----=20 > From: Nathaniel Talbott [mailto:nathaniel@NOSPAMtalbott.ws]=20 > Sent: Tuesday, September 23, 2003 2:29 PM=20 > To: ruby-talk@ruby-lang.org=20 > Subject: Re: exerb and a threaded server=20 >=20 > Berger, Daniel [mailto:djberge@qwest.com] wrote:=20 >=20 > > However, when I tried to build and rbc file, it just hangs:=20 > > C:\test>ruby -r exerb/mkrbc exetest.rb -> hangs indefinitely=20 > >=20 > > Any ideas?=20 >=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 >=20 > HTH,=20 >=20 >=20 > Nathaniel=20 >=20 > <:((><=20 Ah, ok. Because of the curious interaction SIGINT and threads on=20 windows, the first thing I tried was killing this using the Task=20 Manager. However, when I did that the .rbc file was NOT generated.=20 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=20 make a connection in a second terminal with a throw-away client script=20 (which then does kill it). At that point, the .rbc file was generated,=20 I created a .exe and ran it successfully.=20 Anyway, hope that helps future Googler's. And thanks Nathaniel.=20 Regards,=20 Dan=20 ------_=_NextPart_001_01C382AC.98CFB200 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
Worked=20 like a charm!  Thanks!
 
Dan
-----Original Message-----
From: = Albert Chou=20 [mailto:achou@tealeaf.com]
Sent: Tuesday, September 23, = 2003 2:57=20 PM
To: ruby-talk@ruby-lang.org
Subject: Re: exerb = and a=20 threaded server

Dan,

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

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

before the main loop of your program. =


Al


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

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

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

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

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

Regards,

Dan

------_=_NextPart_001_01C382AC.98CFB200--