Dealing with Multiple file descriptor : poll() system call

Why use poll()? Suppose you have to deal with multiple clients connected at the same time. A natural question, then, is: how can you read from multiple file descriptors (sockets) at once? Do you need to make some really annoyingly multi-threaded code to handle each client that’s connected? Do you have to go into some stupid loop constantly checking each socket to see if data’s available? You can resolve this issue efficiently by polling file descriptor(Sockets here)....

September 10, 2016 · 2 min · 266 words · Vishal Chovatiya