Hi,
It seems that it would be great fun to support WEBrick completely, wouldn't it?
I tried this small example, a daytime server:
require 'webrick'
s = WEBrick::GenericServer.new( :Port => 2000 )
trap("INT"){ s.shutdown }
s.start{|sock|
sock.print(Time.now.to_s + "\r\n")
}
Alas, it actually works, but not completely. The big problem is that
WEBrick uses fcntl to close the connection, (or at least that's what it
looks like. I began by adding this to the empty fcntl.rb file:
class Fcntl
F_SETFL = 1
O_RDWR = 2
O_TRUNC = 512
O_RDONLY = 0
O_EXCL = 1024
O_ACCMODE = 3
O_NONBLOCK = 1
O_CREAT = 256
O_WRONLY = 1
O_APPEND = 8
end
When this is there, we get a method missing error, because it seems our
RubyIO doesn't have support for fcntl at all. Obviously this would be good
to have, for certain operations. Any plans on looking at this soon, or is
anyone already looking at it, or should I take a look on getting it
working, at least for TCPSocket?
Regards
Ola Bini
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel