… | |
… | |
125 | =item timeout => $fractional_seconds |
125 | =item timeout => $fractional_seconds |
126 | |
126 | |
127 | If non-zero, then this enables an "inactivity" timeout: whenever this many |
127 | If non-zero, then this enables an "inactivity" timeout: whenever this many |
128 | seconds pass without a successful read or write on the underlying file |
128 | seconds pass without a successful read or write on the underlying file |
129 | handle, the C<on_timeout> callback will be invoked (and if that one is |
129 | handle, the C<on_timeout> callback will be invoked (and if that one is |
130 | missing, an C<ETIMEDOUT> errror will be raised). |
130 | missing, an C<ETIMEDOUT> error will be raised). |
131 | |
131 | |
132 | Note that timeout processing is also active when you currently do not have |
132 | Note that timeout processing is also active when you currently do not have |
133 | any outstanding read or write requests: If you plan to keep the connection |
133 | any outstanding read or write requests: If you plan to keep the connection |
134 | idle then you should disable the timout temporarily or ignore the timeout |
134 | idle then you should disable the timout temporarily or ignore the timeout |
135 | in the C<on_timeout> callback. |
135 | in the C<on_timeout> callback. |
… | |
… | |
155 | isn't finished). |
155 | isn't finished). |
156 | |
156 | |
157 | =item read_size => <bytes> |
157 | =item read_size => <bytes> |
158 | |
158 | |
159 | The default read block size (the amount of bytes this module will try to read |
159 | The default read block size (the amount of bytes this module will try to read |
160 | on each [loop iteration). Default: C<4096>. |
160 | during each (loop iteration). Default: C<8192>. |
161 | |
161 | |
162 | =item low_water_mark => <bytes> |
162 | =item low_water_mark => <bytes> |
163 | |
163 | |
164 | Sets the amount of bytes (default: C<0>) that make up an "empty" write |
164 | Sets the amount of bytes (default: C<0>) that make up an "empty" write |
165 | buffer: If the write reaches this size or gets even samller it is |
165 | buffer: If the write reaches this size or gets even samller it is |
… | |
… | |
238 | } |
238 | } |
239 | |
239 | |
240 | sub _shutdown { |
240 | sub _shutdown { |
241 | my ($self) = @_; |
241 | my ($self) = @_; |
242 | |
242 | |
|
|
243 | delete $self->{_tw}; |
243 | delete $self->{_rw}; |
244 | delete $self->{_rw}; |
244 | delete $self->{_ww}; |
245 | delete $self->{_ww}; |
245 | delete $self->{fh}; |
246 | delete $self->{fh}; |
246 | } |
247 | } |
247 | |
248 | |
… | |
… | |
1060 | ? $self->{filter_r}->($self, $rbuf) |
1061 | ? $self->{filter_r}->($self, $rbuf) |
1061 | : $self->_drain_rbuf; |
1062 | : $self->_drain_rbuf; |
1062 | |
1063 | |
1063 | } elsif (defined $len) { |
1064 | } elsif (defined $len) { |
1064 | delete $self->{_rw}; |
1065 | delete $self->{_rw}; |
1065 | delete $self->{_ww}; |
|
|
1066 | delete $self->{_tw}; |
|
|
1067 | $self->{_eof} = 1; |
1066 | $self->{_eof} = 1; |
1068 | $self->_drain_rbuf; |
1067 | $self->_drain_rbuf; |
1069 | |
1068 | |
1070 | } elsif ($! != EAGAIN && $! != EINTR && $! != WSAEWOULDBLOCK) { |
1069 | } elsif ($! != EAGAIN && $! != EINTR && $! != WSAEWOULDBLOCK) { |
1071 | return $self->error; |
1070 | return $self->error; |