[英]Unix domain sockets and select
Just to make sure sure, one can call select on a Unix Domain socket. 为了确保这一点,可以在Unix域套接字上调用select。 Correct? 正确? Also one can mix different types of sockets in a select statement. 也可以在select语句中混合使用不同类型的套接字。 Is that correct? 那是对的吗?
Yes, that is correct. 对,那是正确的。 The only type of file descriptor you should not put in a select
call is a regular file, because regular files are always considered ready, even if reading from them would block. 您不应该在select
调用中放入的文件描述符的唯一类型是常规文件,因为常规文件始终被认为是就绪的,即使从它们中读取会阻塞。
of course,a socket/pipe/unix domain/msgqueue and something like that will be ok~ 当然,套接字/管道/ unix域/ msgqueue之类的都可以〜
you may use sockpair right now , select / poll / epoll can get it. 您现在可以使用sockpair,选择/ poll / epoll即可获取。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.