Using accept() and select() at the same time?

前端 未结 3 500
余生分开走
余生分开走 2020-12-14 08:18

I\'ve got an event-driven network server program. This program accepts connections from other processes on other hosts. There may be many short-lived connections from diff

3条回答
  •  时光说笑
    2020-12-14 08:52

    Last time I checked, you could just listen on a socket and then select or poll to see if a connection came in. If so, accept it; it will not block (but you may want to really should set O_NONBLOCK just to be sure)

提交回复
热议问题