-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/11/2014 06:21 PM, booch wrote: > You can read/write to a usb device by simply using open/read/write > system commands. > > Try using a uv_fs_t with uv_fs_open/uv_fs_read/uv_fs_write > functions. > > These functions will simply communicate bytes of data which is what > I think you're looking for. >
The problem with that is that the fs operations run in the thread pool. So, if you perform 4 uv_fs_read operations and the read() syscall blocks, the entire thread pool is blocked, that means you cannot run any other operations that require it, like uv_fd_*, uv_queue_work, uv_getaddrinfo. You could try to use a tty or pipe handle. Note that if you use uv_pipe_open you'll need to set the fd to be non-blocking first. Cheers, - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTH3kjAAoJEEEOVVOum8BZZwkQAJtwSvV/GlX6JuLoqlC9VSvR KCXAkk9GKPBPO6bCkNH7y9O4UV4wIf9Z7KXjCerKgPtcGalX/q6E9xqNILYdNxu5 cwel6+Nx4GX0rGmQobVs9NhK9Tg6LEKJSM8JWd78AA4ke3rlbqh2sW9m46CJqKTZ vosRY0fgG4dEdMK1mv9dyxt4k2anFy1SJtiGbFSFLVj2+0+xuQBoypVl5alkxR2y VHO4JX6hYA4P/PO7jG6z33GIw+iRzj9HTigRjJv+qHZoBXlP/nqhea3pki30uIwX 23M8TggZeClpm5u9yIvro4ObjfIEp57ljdQrAZXlZFTo/wq6u8GWSx/vT/5ylWAz moiDJJs1DFyp0ml2EWN0+tRq+7fMhEmhb8178U3VTEHm4lyPJ6Tcv3qjec39Hw9F fl5P/JlZRqfHTfaD5cbig+7+eScQEZz+xkD8Vj5DKih7xLpU0iiczDlhIP4J8o7F 9nLpM08dgaS9Y06RNSNo9dVe1PHlKGvovr/MwJtDdsOOZaeCfloOW8tq9hHrmQ4Z 6meO4HYzAQbuUi4Bbp7zYQIOaja5vYIUCsMZONQc7+mSrG0jQ2Lcu6v1VxCGK8cO LqPHy4IPRRiYd0FoLPinjio6W/EzdQqmL5g84DrHTzSXf+IFqI1MuuA+1Ah45ktJ IKo2T0jdZj6GT68PiYtW =NroZ -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
