[#40498] autoload SYMBOL, XX.rb — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
8 messages
2005/01/08
[#40501] getopt — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
6 messages
2005/01/08
[#40519] What is singletonclass.superclass ? — sheepman <sheepman@...>
こんにちは、sheepman です。
6 messages
2005/01/11
[#40523] Re: アクセス情報の取得について — yuushi44@...
酒匂様、神戸様
4 messages
2005/01/12
[#40546] Net::IMAPの中のinlenって何ですか? — 内木場 美次 <uchikoba@...>
はじめまして。Rubyを始めて2ヶ月ちょっとの
6 messages
2005/01/20
[#40551] Net::IMAPで既に存在するディレクトリが削除できない — 内木場 美次 <uchikoba@...>
お疲れ様です。内木場です。
13 messages
2005/01/21
[#40571] dupとfrozen — Chikara Takamatsu <c_takamatu@...>
始めまして。高松と申します。
5 messages
2005/01/25
[#40580] enum 定数する場合のイディオム — Hiroshi Takagi <gollum@...>
高木@関西のネットワーク屋%Ruby novice monk です。
12 messages
2005/01/27
[#40581] Re: enum 定数する場合のイディオム
— "U.Nakamura" <usa@...>
2005/01/27
こんにちは、なかむら(う)です。
[ruby-list:40492] 使用メモリが減らない
From:
"Tokiwa" <tokiwa@...>
Date:
2005-01-05 11:14:17 UTC
List:
ruby-list #40492
常盤です
rubyでデバグ用TCPプロキシ?みたいなものを作ってみたのですが、
HTTPでアクセスするたびに使用メモリが増えていき解放される気配がありません。
接続はすぐに切断するのでコネクションが残っていることはありませんでした。
何処が不味いところはあるでしょうか? プログラムは以下のようなものです。
-----------
require "socket"
gs = TCPServer.open(80) rescue exit
while gs
Thread.start(gs.accept) do |s|
printf("remotehost: %s\n", (s.peeraddr)[2])
c=(TCPSocket.open("localhost",81) rescue nil)
if c
Thread.start() {
while (ch2=c.sysread(1024) rescue nil)
s.syswrite(ch2) rescue nil
s.flush rescue nil
# print(ch2)
# STDOUT.flush
end
c.close_read rescue nil
s.close_write rescue nil
c.close rescue nil # 不要?
s.close rescue nil # 不要?
}
while (ch=s.sysread(1024) rescue nil)
c.syswrite(ch) rescue nil
c.flush rescue nil
print(ch)
STDOUT.flush
end
c.close_write rescue nil
s.close_read rescue nil
else
s.close
end
end
end
-----------
以上