> Well, I've just found out why the "Invalid file descriptor" was generated. I 
> didn't stop the "read watcher" when creating the "write watcher".
> 
> So, I just maintain my second question:
> What's the most convenient way to write data in a TCP socket:
>     1.- "send" data directly in the read callback
>     2.- Create a write watcher
>     3.- Create a watcher of both types: READ&WRITE.

3 - create (and init) both read and write watcher (but do not start the write 
watcher).

in addition to:

- try to write from the read handler.
- if it fails (or if it cannot be completely full-filled), start the write 
watcher and terminate writing from the write handler.

Chers,
Pierre-Yves


_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to