Overview
| Artifact ID: | f521161eb4dd71f5feaa1464eb0faca71f536c44 |
|---|---|
| Ticket: | 1995063fffffffffffffffffffffffffffffffff
Doc: example in fileevent manpage is bad. |
| User & Date: | avl42 on 2008-06-16 20:38:10 |
Changes
- icomment:
Logged In: YES user_id=830354 Originator: YES ad dkf: huh? This "checking eof only after reading" is appropriate for while loops, where it's usually the reading command that causes the eof to be reached in the first place. fileevent-callbacks are also fired when previous gets returned with no eof-condition, but the channel died afterwards on peer's behalf. At that point, the eof- status for the channel is already set on entry of the handler, so no *need* to try a "gets", first. Of course, you can put another eof-check after the gets but that's redundant, because if eof occurred through "gets", then the handler is immediately called again, anyway, and that time eof is true already. Finally, if it's a writeable event, reading isn't a good idea either, nor is trying to "puts" something, when eof was already true before.
- login: "avl42"
- mimetype: "text/plain"
- username: "avl42"