Click here to Skip to main content
14,244,275 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to create a chat application with a nonblocking socket. for this I am supposed to use the "poll()" function. I understaand that I've to include the "poll.h" header file but my compiler says "No such file or directory found",On the other hand If I don't include this file my code accepts the structure pollfd,it compiles fine but at run time gives me the error that the variable "P is used without being initialised"(I defined "P" to be a pollfd variable) could some one tell me what should I do in this situation... is it possible to download header files? I am working on visual studio 2008.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Take a look at this site:[^]

Q: poll.h does not exist in windows so poll() for sockets does not compile. Is there a way to make it work, or an alternative method?

A: It's my understanding that poll() performs the same functionality as select(). So, if writing portable code, stick to use of the select() function.

Good luck!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100