… | |
… | |
174 | ($_[0]->{ww} ||= Coro::Event->io( |
174 | ($_[0]->{ww} ||= Coro::Event->io( |
175 | fd => $_[0]->{fh}, |
175 | fd => $_[0]->{fh}, |
176 | desc => "$_[0]->{desc} WW", |
176 | desc => "$_[0]->{desc} WW", |
177 | timeout => $_[0]->{timeout}, |
177 | timeout => $_[0]->{timeout}, |
178 | poll => W+E, |
178 | poll => W+E, |
179 | ))->next->got & W; |
179 | ))->next->{Coro::Event}[3] & W; |
180 | } |
180 | } |
181 | |
181 | |
182 | sub readable { |
182 | sub readable { |
183 | ($_[0]->{rw} ||= Coro::Event->io( |
183 | ($_[0]->{rw} ||= Coro::Event->io( |
184 | fd => $_[0]->{fh}, |
184 | fd => $_[0]->{fh}, |
185 | desc => "$_[0]->{desc} RW", |
185 | desc => "$_[0]->{desc} RW", |
186 | timeout => $_[0]->{timeout}, |
186 | timeout => $_[0]->{timeout}, |
187 | poll => R+E, |
187 | poll => R+E, |
188 | ))->next->got & R; |
188 | ))->next->{Coro::Event}[3] & R; |
189 | } |
189 | } |
190 | |
190 | |
191 | sub WRITE { |
191 | sub WRITE { |
192 | my $self = $_[0]; |
192 | my $self = $_[0]; |
193 | my $len = defined $_[2] ? $_[2] : length $_[1]; |
193 | my $len = defined $_[2] ? $_[2] : length $_[1]; |