exerb and a threaded server

B

Berger, Daniel

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C38210.27E1E870
Content-Type: text/plain

Hi all,

Ruby 1.6.8 and 1.8.0
Windows XP Pro
exerb 2.6.7

Just playing around with exerb. I'm aware that there were some socket
issues, so I tried making this into an exe:

# first test
require "socket"
puts "HELLO"

That seemed to work ok.

Then I tried this example, shamelessly stolen from "The Ruby Way", p. 422:

# exetest.rb
require "socket"
PORT = 12321

server = TCPServer.new(PORT)

while session = server.accept
Thread.new(session) do |my_session|
my_session.puts Time.new
my_session.close
end
end

However, when I tried to build and rbc file, it just hangs:

C:\test>ruby -r exerb/mkrbc exetest.rb -> hangs indefinitely

Any ideas?

Regards,

Dan

------_=_NextPart_001_01C38210.27E1E870
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>exerb and a threaded server</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi all,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Ruby 1.6.8 and 1.8.0</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Windows XP Pro</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">exerb 2.6.7</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Just playing around with exerb.&nbsp; =
I'm aware that there were some socket issues, so I tried making this =
into an exe:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial"># first test</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">require &quot;socket&quot;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">puts &quot;HELLO&quot;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">That seemed to work ok.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Then I tried this example, shamelessly =
stolen from &quot;The Ruby Way&quot;, p. 422:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial"># exetest.rb</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">require &quot;socket&quot;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">PORT =3D 12321</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">server =3D TCPServer.new(PORT)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">while session =3D server.accept</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; Thread.new(session) do =
|my_session|</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
my_session.puts Time.new</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
my_session.close</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; end</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">end</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">However, when I tried to build and rbc =
file, it just hangs:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">C:\test&gt;ruby -r exerb/mkrbc =
exetest.rb -&gt; hangs indefinitely</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Any ideas?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Dan</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C38210.27E1E870--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top