… | |
… | |
177 | =cut |
177 | =cut |
178 | |
178 | |
179 | sub accept { |
179 | sub accept { |
180 | my ($peername, $fh); |
180 | my ($peername, $fh); |
181 | while () { |
181 | while () { |
182 | $_[0]->readable or return; |
|
|
183 | |
|
|
184 | $peername = accept $fh, tied(${$_[0]})->{fh} |
182 | $peername = accept $fh, tied(${$_[0]})->{fh} |
185 | and return ($peername, $fh = new_from_fh Coro::Socket $fh); |
183 | and return ($peername, $fh = new_from_fh Coro::Socket $fh); |
186 | |
184 | |
187 | return unless $!{EAGAIN}; |
185 | return unless $!{EAGAIN}; |
|
|
186 | |
|
|
187 | $_[0]->readable or return; |
188 | } |
188 | } |
189 | } |
189 | } |
190 | |
190 | |
191 | 1; |
191 | 1; |
192 | |
192 | |