English 中文(简体)
袖珍: 选择(阅读、书写,除fds外)
原标题:Sockets: Select (readfds, writefds, exceptfds)

这些类别中的每个类别都有什么描述? 我不理解这一意图,为什么可以用可读的一组文字书写,并从可解释的一组文字读取? 读书是什么?

In all the examples I ve seen, the management of these groups is done manually, except for the read group. The question then is, why is it possible to write data in readable group? And why is it possible to read in the write group? Because then the meaning of these groups is lost and for each group it is necessary to write identical control logic?

问题回答

为什么能用可读写的一组文字来读写?

Each of the sets is just that: a set of integers, with each integer in the set representing one socket that is part of that set. So you can t "read" or "write" from a set; you can only add integers to the set, or not add them, and then pass that set to select().

请注意,这与下列专题完全不同:电话recv()send(<>>/code> on a individual socket se,无论你在fd_sets上的位置如何,你在任何时候均可在任何单册上填写。

读写法具体规定了你希望制作的<条码>电子显示(<>>/代码>)的袖珍,一俟准备好(即,其中至少有一份有数据可供你收集<条码>recv(<>>>>>)。

该笔记本具体列明了你希望制作的<条码>电子显示()的袖珍,一俟它们做好了准备(即,其中至少有一人已经停泊空出,以便你可以打电话到<条码>,并至少将一些数据输入其即将到来的数据-数据-显示权)。

采用例外处理法(通常是以专门处理本组织问题的方式)来通知你,某些索赔案有特殊的情况。 我建议,现在就无视这一规定,而只是通过民族解放军,这是我的论点。

读书是什么?

当其即将进行的数据储存不完整时,便可读书。 (即,如果您可以打电话到send(>)和send(<>/code>,将至少能将一组数据输入缓冲,因此不必阻挡或退回-1/EWOULDBK)

The question then is, why is it possible to write data in readable group?

It s always possible(*) to call send() or write() on any socket. That remains true even if you are also interested in having select() return when that socket is ready-for-read.

And why is it possible to read in the write group?

总是可以(*)打电话到<代码>recv(>或read()。 即便你也有兴趣获得<条码>选择(>)的回程,只要该表已经准备好。

既然如此,这些团体的含义就会消失,对于每个群体来说,必须写出相同的控制逻辑?

情况并非如此。 这些小组的含义与你如何要求<条码>电子显示()行事有关,特别是,哪些国家应当导致<条码>电子表述()。 这与你在<条形码>后填表(<>条码/代码>)中恢复的实际内容无关;这取决于你。

(*) 指出,“可行”必然意味着“有用”;例如,如果您在一份尚未准备好的目录上打电话recv(),那么recv(>>打电话要么在有些数据到达之前被封,要么(如果单列单是非锁定方式),将立即退回<代码>-1/EWOULDBK。 这些行为可能不是你想要的。





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签