Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
5.00/5 (1 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.
Posted

1 solution

Take a look at this site: http://forums.codeguru.com/showthread.php?460259-pollfd-in-windows[^]

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!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900