From: Tanaka Akira Date: 2010-07-07T00:04:50+09:00 Subject: [ruby-dev:41836] Re: [bug:trunk] GNU/Linux select hang on a socket which TCP state is CLOSED 2010年7月6日23:53 KOSAKI Motohiro : >> これがLinuxのselectのバグだとすると、そちらを直してもらうべ >> くレポートするべきなんでしょうか。 > > SUSみると > > If the writefds argument is not a null pointer, it points to an object > of type fd_set that on input specifies the file descriptors to be > checked for being ready to write, and on output indicates which file > descriptors are ready to write. > > と、ready to writeという表現なので、EPIPEになっちゃうようなfdはreadyちゃうわい。というのも解釈として全然不自然ではないような。。。 > 何か見落としているだろうか? ready to write の意味は以下のように説明されているので、 EPIPE だろうが would not block なので ready だ、ということで。 A descriptor shall be considered ready for writing when a call to an output function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully. なお、Ruby 1.9 的にはそもそもなんで select しているのか、という点を 調べないといけないと思っています。 Ruby 1.8 的には select するのはある程度そういうものなわけですが。 -- [田中 哲][たなか あきら][Tanaka Akira]