Версия для печати
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум на Исходниках.RU > *nix > poll


Автор: settler 30.07.18, 11:03
В poll.h есть флаги

<{CODE_COLLAPSE_OFF}><{CODE_WRAP_OFF}>
    #define POLLIN      0x001       /* There is data to read.  */
    #define POLLPRI     0x002       /* There is urgent data to read.  */
    #define POLLOUT     0x004       /* Writing now will not block.  */
     
    #if defined __USE_XOPEN || defined __USE_XOPEN2K8
    /* These values are defined in XPG4.2.  */
    # define POLLRDNORM 0x040       /* Normal data may be read.  */
    # define POLLRDBAND 0x080       /* Priority data may be read.  */
    # define POLLWRNORM 0x100       /* Writing now will not block.  */
    # define POLLWRBAND 0x200       /* Priority data may be written.  */
    #endif
     
    #ifdef __USE_GNU
    /* These are extensions for Linux.  */
    # define POLLMSG    0x400
    # define POLLREMOVE 0x1000
    # define POLLRDHUP  0x2000
    #endif
     
    /* Event types always implicitly polled for.  These bits need not be set in
       `events', but they will appear in `revents' to indicate the status of
       the file descriptor.  */
    #define POLLERR     0x008       /* Error condition.  */
    #define POLLHUP     0x010       /* Hung up.  */
    #define POLLNVAL    0x020       /* Invalid polling request.  */


POLLIN понятно , а что значит POLLRDNORM , POLLPRI? POLLRDBAND?
что значит urgent data ? Priority data ? , как это грамотно применять ?

Автор: JoeUser 30.07.18, 16:44
Цитата settler @
как это грамотно применять ?

Для какой задачи? Приведи код или псевдокод, и преследуемую цель!

Автор: Oleg2004 31.07.18, 20:21
Цитата settler @
что значит urgent data

Насчет этого можно сказать совершенно точно - в полученном TCP-сегменте присутствует байт срочных данных - в заголовке сегмента используется флаг URG - urgent data. Почитать о его применении можно у Стивенса Стивенс У.Р. UNIX: разработка сетевых приложений СПБ.: Питер, 2003
Приоритетные данные можно почитать здесь:
http://orc.csres.utexas.edu/documentation/...ioritypoll.html
Про остальное вот здесь:
https://www.ibm.com/support/knowledgecenter...2/cpp_poll.html

Powered by Invision Power Board (https://www.invisionboard.com)
© Invision Power Services (https://www.invisionpower.com)